diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-03 09:29:19 +0200 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-06-04 09:06:25 +0000 |
commit | 503019f5021599decb37448b19ca8d7d0cbcda1e (patch) | |
tree | c8aed110cf9d28a58da511662e6ccfc4b8918226 /tests | |
parent | f5eca5209ccb8c4b4719d102619fb3e36b88b317 (diff) | |
download | nextcloud-server-503019f5021599decb37448b19ca8d7d0cbcda1e.tar.gz nextcloud-server-503019f5021599decb37448b19ca8d7d0cbcda1e.zip |
Prevent harder to share your root
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/Share20/ManagerTest.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php index da5890f8372..3d9320986b1 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -635,7 +635,7 @@ class ManagerTest extends \Test\TestCase { $rootFolder = $this->createMock(Folder::class); $rootFolder->method('isShareable')->willReturn(true); $rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL); - $rootFolder->method('getPath')->willReturn('myrootfolder'); + $rootFolder->method('getId')->willReturn(42); $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_USER, $rootFolder, $user2, $user0, $user0, 30, null, null), 'You can’t share your root folder', true]; $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $rootFolder, $group0, $user0, $user0, 2, null, null), 'You can’t share your root folder', true]; @@ -695,7 +695,9 @@ class ManagerTest extends \Test\TestCase { ])); $userFolder = $this->createMock(Folder::class); - $userFolder->method('getPath')->willReturn('myrootfolder'); + $userFolder->expects($this->any()) + ->method('getId') + ->willReturn(42); $userFolder->expects($this->any()) ->method('getRelativePath') ->willReturnArgument(0); |