[Pkg-owncloud-commits] [owncloud] 23/86: Add a unit test that executes the query
David Prévot
taffit at moszumanska.debian.org
Tue Dec 22 16:51:55 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.1.5
in repository owncloud.
commit cef8c875f995d2b8d98b2931d9d332f73efe3aa7
Author: Joas Schilling <nickvergessen at owncloud.com>
Date: Wed Nov 18 10:32:29 2015 +0100
Add a unit test that executes the query
---
apps/files/tests/activitytest.php | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/apps/files/tests/activitytest.php b/apps/files/tests/activitytest.php
index 485c559..fba4138 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) {
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list