summaryrefslogtreecommitdiffstats
path: root/tests/lib/Share20
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2020-06-03 09:29:19 +0200
committerJoas Schilling <coding@schilljs.com>2020-06-03 14:47:38 +0200
commit69eda9c0f6a3f0128475cde8f9e021c71677c51d (patch)
treec4d32503e5a0a12f2427273850e10ece8b1c80ef /tests/lib/Share20
parent796b454021785ac5be8ffb99935e28f1abaaa171 (diff)
downloadnextcloud-server-69eda9c0f6a3f0128475cde8f9e021c71677c51d.tar.gz
nextcloud-server-69eda9c0f6a3f0128475cde8f9e021c71677c51d.zip
Prevent harder to share your root
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'tests/lib/Share20')
-rw-r--r--tests/lib/Share20/ManagerTest.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/lib/Share20/ManagerTest.php b/tests/lib/Share20/ManagerTest.php
index 54feedf15ce..e66ac51aeea 100644
--- a/tests/lib/Share20/ManagerTest.php
+++ b/tests/lib/Share20/ManagerTest.php
@@ -646,7 +646,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];
@@ -706,7 +706,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);