summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2016-02-29 08:53:58 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2016-02-29 08:53:58 +0100
commit6526c122afa2c141f4cd5ffd7e292f7a5556cf61 (patch)
tree5db3811e1099a8c53813c2c354a0379e23fdd0c0 /tests/lib
parent5800585039836f138fcc40ca7a05053fdfbf2454 (diff)
parentb116e80c5629caab679e158813f1b3fda13cb501 (diff)
downloadnextcloud-server-6526c122afa2c141f4cd5ffd7e292f7a5556cf61.tar.gz
nextcloud-server-6526c122afa2c141f4cd5ffd7e292f7a5556cf61.zip
Merge pull request #22683 from owncloud/fix_22682
Relax rootfolder check
Diffstat (limited to 'tests/lib')
-rw-r--r--tests/lib/share20/managertest.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/lib/share20/managertest.php b/tests/lib/share20/managertest.php
index d388d56ce3d..4f23dd0e6d0 100644
--- a/tests/lib/share20/managertest.php
+++ b/tests/lib/share20/managertest.php
@@ -644,6 +644,15 @@ class ManagerTest extends \Test\TestCase {
$data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_GROUP, $limitedPermssions, $group0, $user0, $user0, 17, null, null), 'Cannot increase permissions of path', true];
$data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $limitedPermssions, null, $user0, $user0, 3, null, null), 'Cannot increase permissions of path', true];
+ $rootFolder = $this->getMock('\OCP\Files\Folder');
+ $rootFolder->method('isShareable')->willReturn(true);
+ $rootFolder->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
+ $rootFolder->method('getPath')->willReturn('myrootfolder');
+
+ $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];
+ $data[] = [$this->createShare(null, \OCP\Share::SHARE_TYPE_LINK, $rootFolder, null, $user0, $user0, 16, null, null), 'You can\'t share your root folder', true];
+
$allPermssions = $this->getMock('\OCP\Files\Folder');
$allPermssions->method('isShareable')->willReturn(true);
$allPermssions->method('getPermissions')->willReturn(\OCP\Constants::PERMISSION_ALL);
@@ -678,8 +687,10 @@ class ManagerTest extends \Test\TestCase {
]));
$userFolder = $this->getMock('\OCP\Files\Folder');
+ $userFolder->method('getPath')->willReturn('myrootfolder');
$this->rootFolder->method('getUserFolder')->willReturn($userFolder);
+
try {
$this->invokePrivate($this->manager, 'generalCreateChecks', [$share]);
$thrown = false;