diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-11-18 10:32:29 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-11-18 10:37:23 +0100 |
commit | 61dbfb996f9a1c69f571d22d5255f7b9643e7393 (patch) | |
tree | ea47a9ecb682c63f0b7087c13b940a740d2171f7 /apps | |
parent | e3434fecfe8ef682133476997e713d2592d606fd (diff) | |
download | nextcloud-server-61dbfb996f9a1c69f571d22d5255f7b9643e7393.tar.gz nextcloud-server-61dbfb996f9a1c69f571d22d5255f7b9643e7393.zip |
Add a unit test that executes the query
Diffstat (limited to 'apps')
-rw-r--r-- | apps/files/tests/activitytest.php | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/files/tests/activitytest.php b/apps/files/tests/activitytest.php index 485c559d488..fba41386cab 100644 --- a/apps/files/tests/activitytest.php +++ b/apps/files/tests/activitytest.php @@ -333,6 +333,19 @@ class ActivityTest extends TestCase { $result = $this->activityExtension->getQueryForFilter('all'); $this->assertEquals([$query, $parameters], $result); + + $this->executeQueryForFilter($result); + } + + public function executeQueryForFilter(array $result) { + list($resultQuery, $resultParameters) = $result; + $resultQuery = str_replace('`file`', '`user`', $resultQuery); + $resultQuery = str_replace('`type`', '`key`', $resultQuery); + + $connection = \OC::$server->getDatabaseConnection(); + $result = $connection->executeQuery('SELECT * FROM `*PREFIX*privatedata` WHERE ' . $resultQuery, $resultParameters); + $rows = $result->fetchAll(); + $result->closeCursor(); } protected function mockUserSession($user) { |