diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-04-23 19:10:00 +0200 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2017-04-24 11:33:07 +0200 |
commit | de6b05a911118583178830a33f19b9010c480398 (patch) | |
tree | 431b0929238faf6358c18a77ceebed42b270683d /tests/lib/Share20 | |
parent | dcc8cce28b3c47dd7f6c1684fdb0793102164fb2 (diff) | |
download | nextcloud-server-de6b05a911118583178830a33f19b9010c480398.tar.gz nextcloud-server-de6b05a911118583178830a33f19b9010c480398.zip |
Add missing hook check
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests/lib/Share20')
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 6a389fcdf9a..d8a637ef021 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -2510,6 +2510,7 @@ class ManagerTest extends \Test\TestCase { $share->setProviderId('foo') ->setId('42') ->setShareType(\OCP\Share::SHARE_TYPE_LINK) + ->setToken('token') ->setSharedBy('owner') ->setShareOwner('owner') ->setPassword('password') @@ -2542,8 +2543,18 @@ class ManagerTest extends \Test\TestCase { ]); $hookListner2 = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock(); - \OCP\Util::connectHook('OCP\Share', 'post_update_permissions', $hookListner2, 'post'); - $hookListner2->expects($this->never())->method('post'); + \OCP\Util::connectHook('OCP\Share', 'post_update_password', $hookListner2, 'post'); + $hookListner2->expects($this->once())->method('post')->with([ + 'itemType' => 'file', + 'itemSource' => 100, + 'uidOwner' => 'owner', + 'token' => 'token', + 'disabled' => false, + ]); + + $hookListner3 = $this->getMockBuilder('Dummy')->setMethods(['post'])->getMock(); + \OCP\Util::connectHook('OCP\Share', 'post_update_permissions', $hookListner3, 'post'); + $hookListner3->expects($this->never())->method('post'); $manager->updateShare($share); |