diff options
author | Robin Appelman <robin@icewind.nl> | 2015-03-24 17:54:11 +0100 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2015-03-24 17:54:11 +0100 |
commit | 1bd141b65511983326f0076b676b14e1528ddd65 (patch) | |
tree | da23be9fc2f7b51952c9c8cdb1840d201b1461b3 /apps | |
parent | 2370af62ea5ef3c276cd4c3db52509dc0c503559 (diff) | |
parent | 7de15f312577b3ee5f8d05c9f048000376e69a46 (diff) | |
download | nextcloud-server-1bd141b65511983326f0076b676b14e1528ddd65.tar.gz nextcloud-server-1bd141b65511983326f0076b676b14e1528ddd65.zip |
Merge pull request #15158 from owncloud/fix-failing-master
Fix failing master unit tests
Diffstat (limited to 'apps')
-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) { |