summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-02-26 16:05:32 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-02-26 16:05:32 +0100
commitb116e80c5629caab679e158813f1b3fda13cb501 (patch)
tree5008b318097cf35d4d15eb2a0f65911211fb308e /tests
parent5fa6d3ea5802c705c2883edf1d24bbd330defdcb (diff)
downloadnextcloud-server-b116e80c5629caab679e158813f1b3fda13cb501.tar.gz
nextcloud-server-b116e80c5629caab679e158813f1b3fda13cb501.zip
Relax rootfolder check
* Updated unit tests * Added intergration test
Diffstat (limited to 'tests')
-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 2c40bf65c2c..27444d90356 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;