diff options
author | Joas Schilling <coding@schilljs.com> | 2019-07-02 11:22:30 +0300 |
---|---|---|
committer | Backportbot <backportbot-noreply@rullzer.com> | 2019-07-03 21:08:08 +0300 |
commit | 16d13542396c1221ca1d2bb2e17dcf57d646edfc (patch) | |
tree | 14706c6cd9df0f1e4022085b700a23905e1e47f9 /tests | |
parent | 88114a4d3fcbecf5cf61d9a770c736d88c097312 (diff) |
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 ddbfe857222..747ad556c05 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -590,6 +590,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]; |