]> source.dussan.org Git - nextcloud-server.git/commitdiff
*cough*
authorJoas Schilling <nickvergessen@owncloud.com>
Tue, 24 Mar 2015 15:25:54 +0000 (16:25 +0100)
committerJoas Schilling <nickvergessen@owncloud.com>
Tue, 24 Mar 2015 16:08:03 +0000 (17:08 +0100)
apps/files_sharing/lib/external/manager.php
apps/files_sharing/tests/external/manager.php

index 5234684a81c3676031750bb0da481e26b922d1e4..1d937c290439f12164e93c961db65edaabf84140 100644 (file)
@@ -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';
index dcb3dfba692b2b574b2013e1d3ae29882b2d6767..3f8ac951ea60679336469cd80c31fd9e73b71ef3 100644 (file)
@@ -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) {