diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/lib/share20/managertest.php | 30 |
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]); } |