diff options
author | Joas Schilling <nickvergessen@owncloud.com> | 2015-03-24 16:25:54 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@owncloud.com> | 2015-05-04 10:43:18 +0200 |
commit | c501ca9ba45229c9c2febeaab54c1cddddfe65fd (patch) | |
tree | 2097382eb2fbfb36cb442e8da4607e4ba671e98a | |
parent | 739e5f9fd64c9e97521ffbee053128c4739111f6 (diff) | |
download | nextcloud-server-c501ca9ba45229c9c2febeaab54c1cddddfe65fd.tar.gz nextcloud-server-c501ca9ba45229c9c2febeaab54c1cddddfe65fd.zip |
*cough*
-rw-r--r-- | apps/files_sharing/lib/external/manager.php | 2 | ||||
-rw-r--r-- | apps/files_sharing/tests/external/manager.php | 17 |
2 files changed, 14 insertions, 5 deletions
diff --git a/apps/files_sharing/lib/external/manager.php b/apps/files_sharing/lib/external/manager.php index 5234684a81c..1d937c29043 100644 --- a/apps/files_sharing/lib/external/manager.php +++ b/apps/files_sharing/lib/external/manager.php @@ -368,7 +368,7 @@ class Manager { $query = 'SELECT * FROM `*PREFIX*share_external` WHERE `user` = ?'; $parameters = [$this->uid]; if (!is_null($accepted)) { - $query .= 'AND `accepted` = ?'; + $query .= ' AND `accepted` = ?'; $parameters[] = (int) $accepted; } $query .= ' ORDER BY `id` ASC'; diff --git a/apps/files_sharing/tests/external/manager.php b/apps/files_sharing/tests/external/manager.php index dcb3dfba692..3f8ac951ea6 100644 --- a/apps/files_sharing/tests/external/manager.php +++ b/apps/files_sharing/tests/external/manager.php @@ -21,7 +21,7 @@ namespace OCA\Files_sharing\Tests\External; use OC\Files\Storage\StorageFactory; -use Test\TestCase; +use OCA\Files_Sharing\Tests\TestCase; class Manager extends TestCase { private $uid; @@ -37,14 +37,23 @@ class Manager extends TestCase { private $instance; public function setUp() { - $this->uid = uniqid(); + parent::setUp(); + + $this->uid = $this->getUniqueID('user'); + $this->mountManager = new \OC\Files\Mount\Manager(); - $this->instance = new \OCA\Files_Sharing\External\Manager(\OC::$server->getDatabaseConnection(), - $this->mountManager, new StorageFactory(), \OC::$server->getHTTPHelper(), $this->uid); + $this->instance = new \OCA\Files_Sharing\External\Manager( + \OC::$server->getDatabaseConnection(), + $this->mountManager, + new StorageFactory(), + $this->getMockBuilder('\OC\HTTPHelper')->disableOriginalConstructor()->getMock(), + $this->uid + ); } public function tearDown() { $this->instance->removeUserShares($this->uid); + parent::tearDown(); } private function getFullPath($path) { |