diff options
author | Joas Schilling <coding@schilljs.com> | 2020-06-03 10:29:19 +0300 |
---|---|---|
committer | backportbot[bot] <backportbot[bot]@users.noreply.github.com> | 2020-06-04 12:03:54 +0300 |
commit | f97a61aa1421359c76062d0cbce9f59af302dc6b (patch) | |
tree | 497e2d1caa3e416354af43479ae6d6dbc2a7d465 /tests | |
parent | 857b09e068e003a7e5c52e6f5c686cb7eb50e09f (diff) |
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 9bc1531ac7f..476413b67ad 100644 --- a/tests/lib/Share20/ManagerTest.php +++ b/tests/lib/Share20/ManagerTest.php @@ -647,7 +647,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]; @@ -707,7 +707,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); |