Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-18 18:36:27 +0300
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-22 14:37:20 +0300
commitaa75cfcf144eda64db1ff5df8a255c3c23b869fd (patch)
treed99bf31967773c3b559dcad81071d2508d6fd937 /tests
parente9fc791e9fc72395193f66fa428be84d97ce3cab (diff)
Block group sharing in API and in share manager
* Fix tests
Diffstat (limited to 'tests')
-rw-r--r--tests/lib/share20/managertest.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/lib/share20/managertest.php b/tests/lib/share20/managertest.php
index 4f23dd0e6d0..2f45de86b98 100644
--- a/tests/lib/share20/managertest.php
+++ b/tests/lib/share20/managertest.php
@@ -1149,6 +1149,22 @@ class ManagerTest extends \Test\TestCase {
/**
* @expectedException Exception
+ * @expectedExceptionMessage Group sharing is now allowed
+ */
+ public function testGroupCreateChecksShareWithGroupMembersGroupSharingNotAllowed() {
+ $share = $this->manager->newShare();
+
+ $this->config
+ ->method('getAppValue')
+ ->will($this->returnValueMap([
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'no'],
+ ]));
+
+ $this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
+ }
+
+ /**
+ * @expectedException Exception
* @expectedExceptionMessage Only sharing within your own groups is allowed
*/
public function testGroupCreateChecksShareWithGroupMembersOnlyNotInGroup() {
@@ -1167,6 +1183,7 @@ class ManagerTest extends \Test\TestCase {
->method('getAppValue')
->will($this->returnValueMap([
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
]));
$this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
@@ -1195,6 +1212,7 @@ class ManagerTest extends \Test\TestCase {
->method('getAppValue')
->will($this->returnValueMap([
['core', 'shareapi_only_share_with_group_members', 'no', 'yes'],
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
]));
$this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
@@ -1222,6 +1240,12 @@ class ManagerTest extends \Test\TestCase {
->with($path)
->willReturn([$share2]);
+ $this->config
+ ->method('getAppValue')
+ ->will($this->returnValueMap([
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
+ ]));
+
$this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
}
@@ -1240,6 +1264,12 @@ class ManagerTest extends \Test\TestCase {
->with($path)
->willReturn([$share2]);
+ $this->config
+ ->method('getAppValue')
+ ->will($this->returnValueMap([
+ ['core', 'shareapi_allow_group_sharing', 'yes', 'yes'],
+ ]));
+
$this->invokePrivate($this->manager, 'groupCreateChecks', [$share]);
}