diff options
author | Vincent Petry <pvince81@owncloud.com> | 2016-05-23 09:52:13 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2016-05-23 09:52:13 +0200 |
commit | 5ba1add03ccd3c4f72a72e5e31f986af42acc8de (patch) | |
tree | a4dd71aa2822367ee584055613e1922c327345b0 /tests | |
parent | c78bb2ab340472c682add8bbe86c25379ef5740c (diff) | |
parent | 20852fd8c071b949962406d7ffb3b6e173eb171b (diff) | |
download | nextcloud-server-5ba1add03ccd3c4f72a72e5e31f986af42acc8de.tar.gz nextcloud-server-5ba1add03ccd3c4f72a72e5e31f986af42acc8de.zip |
Merge pull request #24603 from owncloud/federated_reshare
flat federated re-share
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Share20/DefaultShareProviderTest.php | 8 | ||||
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 5 | ||||
-rw-r--r-- | tests/lib/Share20/ShareTest.php | 3 |
3 files changed, 11 insertions, 5 deletions
diff --git a/tests/lib/Share20/DefaultShareProviderTest.php b/tests/lib/Share20/DefaultShareProviderTest.php index 44a48535b9b..6ef00721a70 100644 --- a/tests/lib/Share20/DefaultShareProviderTest.php +++ b/tests/lib/Share20/DefaultShareProviderTest.php @@ -57,6 +57,8 @@ class DefaultShareProviderTest extends \Test\TestCase { $this->groupManager = $this->getMock('OCP\IGroupManager'); $this->rootFolder = $this->getMock('OCP\Files\IRootFolder'); + $this->userManager->expects($this->any())->method('userExists')->willReturn(true); + //Empty share table $this->dbConn->getQueryBuilder()->delete('share')->execute(); @@ -587,7 +589,7 @@ class DefaultShareProviderTest extends \Test\TestCase { } public function testCreateUserShare() { - $share = new \OC\Share20\Share($this->rootFolder); + $share = new \OC\Share20\Share($this->rootFolder, $this->userManager); $shareOwner = $this->getMock('OCP\IUser'); $shareOwner->method('getUID')->WillReturn('shareOwner'); @@ -635,7 +637,7 @@ class DefaultShareProviderTest extends \Test\TestCase { } public function testCreateGroupShare() { - $share = new \OC\Share20\Share($this->rootFolder); + $share = new \OC\Share20\Share($this->rootFolder, $this->userManager); $shareOwner = $this->getMock('\OCP\IUser'); $shareOwner->method('getUID')->willReturn('shareOwner'); @@ -683,7 +685,7 @@ class DefaultShareProviderTest extends \Test\TestCase { } public function testCreateLinkShare() { - $share = new \OC\Share20\Share($this->rootFolder); + $share = new \OC\Share20\Share($this->rootFolder, $this->userManager); $shareOwner = $this->getMock('\OCP\IUser'); $shareOwner->method('getUID')->willReturn('shareOwner'); diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 7d79150449c..a50ea6c892a 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -2283,6 +2283,9 @@ class ManagerTest extends \Test\TestCase { } public function testUpdateShareUser() { + + $this->userManager->expects($this->any())->method('userExists')->willReturn(true); + $manager = $this->createManagerMock() ->setMethods([ 'canShare', @@ -2567,4 +2570,4 @@ class DummyFactory implements IProviderFactory { public function getProviderForType($shareType) { return $this->provider; } -}
\ No newline at end of file +} diff --git a/tests/lib/Share20/ShareTest.php b/tests/lib/Share20/ShareTest.php index fdfc69f6577..91bd2fe84b6 100644 --- a/tests/lib/Share20/ShareTest.php +++ b/tests/lib/Share20/ShareTest.php @@ -36,7 +36,8 @@ class ShareTest extends \Test\TestCase { public function setUp() { $this->rootFolder = $this->getMock('\OCP\Files\IRootFolder'); - $this->share = new \OC\Share20\Share($this->rootFolder); + $this->userManager = $this->getMock('OCP\IUserManager'); + $this->share = new \OC\Share20\Share($this->rootFolder, $this->userManager); } /** |