summaryrefslogtreecommitdiffstats
path: root/tests/lib
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@owncloud.com>2016-03-18 16:36:27 +0100
committerRoeland Jago Douma <rullzer@owncloud.com>2016-03-22 17:13:34 +0100
commit52826d0e24b354a38220a904fd21bb1860c70870 (patch)
tree4ad114e54d249d200d987bbfbc2c2c05d7325066 /tests/lib
parent195efc12eb8c4be01d3160bcb1b8cd3d78a0767b (diff)
downloadnextcloud-server-52826d0e24b354a38220a904fd21bb1860c70870.tar.gz
nextcloud-server-52826d0e24b354a38220a904fd21bb1860c70870.zip
Block group sharing in API and in share manager
* Fix tests
Diffstat (limited to 'tests/lib')
-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]);
}