summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@owncloud.com>2015-11-18 10:32:29 +0100
committerJoas Schilling <nickvergessen@owncloud.com>2015-11-30 17:14:47 +0100
commit6e0596432c174b73d11b5bfba04f53108d788d9a (patch)
tree971c0b8795ab5baba26797ba0dac7d26869dd03c /apps
parent2cdec74e8a1dd68f757ab89d64aeafac9e56d0ed (diff)
downloadnextcloud-server-6e0596432c174b73d11b5bfba04f53108d788d9a.tar.gz
nextcloud-server-6e0596432c174b73d11b5bfba04f53108d788d9a.zip
Add a unit test that executes the query
Diffstat (limited to 'apps')
-rw-r--r--apps/files/tests/activitytest.php15
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/files/tests/activitytest.php b/apps/files/tests/activitytest.php
index 485c559d488..f6a21a7db62 100644
--- a/apps/files/tests/activitytest.php
+++ b/apps/files/tests/activitytest.php
@@ -333,6 +333,21 @@ 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();
+ // Test the query on the privatedata table, because the activity table
+ // does not exist in core
+ $result = $connection->executeQuery('SELECT * FROM `*PREFIX*privatedata` WHERE ' . $resultQuery, $resultParameters);
+ $rows = $result->fetchAll();
+ $result->closeCursor();
}
protected function mockUserSession($user) {