summaryrefslogtreecommitdiffstats
path: root/tests/lib/UtilTest.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/UtilTest.php')
-rw-r--r--tests/lib/UtilTest.php49
1 files changed, 0 insertions, 49 deletions
diff --git a/tests/lib/UtilTest.php b/tests/lib/UtilTest.php
index 6e25ce16e75..e21a5323b1b 100644
--- a/tests/lib/UtilTest.php
+++ b/tests/lib/UtilTest.php
@@ -10,8 +10,6 @@ namespace Test;
use OC_Util;
use OCP\App\IAppManager;
-use OCP\IConfig;
-use OCP\IUser;
/**
* Class UtilTest
@@ -172,53 +170,6 @@ class UtilTest extends \Test\TestCase {
}
/**
- * @dataProvider dataProviderForTestIsSharingDisabledForUser
- * @param array $groups existing groups
- * @param array $membership groups the user belong to
- * @param array $excludedGroups groups which should be excluded from sharing
- * @param bool $expected expected result
- */
- public function testIsSharingDisabledForUser($groups, $membership, $excludedGroups, $expected) {
- $config = $this->getMockBuilder(IConfig::class)->disableOriginalConstructor()->getMock();
- $groupManager = $this->getMockBuilder('OCP\IGroupManager')->disableOriginalConstructor()->getMock();
- $user = $this->getMockBuilder(IUser::class)->disableOriginalConstructor()->getMock();
-
- $config
- ->expects($this->at(0))
- ->method('getAppValue')
- ->with('core', 'shareapi_exclude_groups', 'no')
- ->willReturn('yes');
- $config
- ->expects($this->at(1))
- ->method('getAppValue')
- ->with('core', 'shareapi_exclude_groups_list')
- ->willReturn(json_encode($excludedGroups));
-
- $groupManager
- ->expects($this->at(0))
- ->method('getUserGroupIds')
- ->with($user)
- ->willReturn($membership);
-
- $result = \OC_Util::isSharingDisabledForUser($config, $groupManager, $user);
-
- $this->assertSame($expected, $result);
- }
-
- public function dataProviderForTestIsSharingDisabledForUser() {
- return [
- // existing groups, groups the user belong to, groups excluded from sharing, expected result
- [['g1', 'g2', 'g3'], [], ['g1'], false],
- [['g1', 'g2', 'g3'], [], [], false],
- [['g1', 'g2', 'g3'], ['g2'], ['g1'], false],
- [['g1', 'g2', 'g3'], ['g2'], [], false],
- [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1'], false],
- [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2'], true],
- [['g1', 'g2', 'g3'], ['g1', 'g2'], ['g1', 'g2', 'g3'], true],
- ];
- }
-
- /**
* Test default apps
*
* @dataProvider defaultAppsProvider