diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-02 10:22:30 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2019-07-03 14:00:13 +0200 |
commit | e4addbae3e564b6009dc09c6c5e36c018cd8d5d0 (patch) | |
tree | 34b6c4e2cab19f9ce9cab940cc55cfbdf55aea0c /tests | |
parent | eaabe97373baa68b5e3c396bf8e1f5a3f17ac1b6 (diff) | |
download | nextcloud-server-e4addbae3e564b6009dc09c6c5e36c018cd8d5d0.tar.gz nextcloud-server-e4addbae3e564b6009dc09c6c5e36c018cd8d5d0.zip |
Better check reshare permissions when creating a share
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index 43310f7e05f..417ba2ebc93 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -589,6 +589,12 @@ class ManagerTest extends \Test\TestCase { $limitedPermssions->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_READ); $limitedPermssions->method('getPath')->willReturn('path'); + $owner = $this->createMock(IUser::class); + $owner->method('getUID') + ->willReturn($user0); + $limitedPermssions->method('getOwner') + ->willReturn($owner); + $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_USER, $limitedPermssions, $user2, $user0, $user0, null, null, null), 'A share requires permissions', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, null, null, null), 'A share requires permissions', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $limitedPermssions, null, $user0, $user0, null, null, null), 'A share requires permissions', true]; |