11<?php
2+
23/**
34 * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
45 * SPDX-License-Identifier: AGPL-3.0-or-later
1819use OCP \Share \IShare ;
1920use Test \TestCase ;
2021
21- use function PHPUnit \Framework \isEmpty ;
22-
2322class GroupPluginTest extends TestCase {
2423 /** @var IConfig|\PHPUnit\Framework\MockObject\MockObject */
2524 protected $ config ;
@@ -69,7 +68,6 @@ public function instantiatePlugin() {
6968 // up with configuration etc. first
7069 $ this ->plugin = new GroupPlugin (
7170 $ this ->config ,
72- $ this ->appConfig ,
7371 $ this ->groupManager ,
7472 $ this ->session
7573 );
@@ -410,15 +408,26 @@ public function dataGetGroups(): array {
410408 true ,
411409 $ this ->getGroupMock ('test ' ),
412410 ],
411+ [
412+ 'test ' , false , false , false ,
413+ [
414+ $ this ->getGroupMock ('test ' , null , true ),
415+ $ this ->getGroupMock ('test1 ' ),
416+ ],
417+ [],
418+ [],
419+ [],
420+ true ,
421+ false ,
422+ ],
413423 [
414424 'test ' , true , true , false ,
415425 [
416- $ this ->getGroupMock ('test0 ' ),
426+ $ this ->getGroupMock ('test0 ' , ' test0 ' , true ),
417427 $ this ->getGroupMock ('test1 ' ),
418428 ],
419429 [
420- $ this ->getGroupMock ('test ' ),
421- $ this ->getGroupMock ('test0 ' ),
430+ $ this ->getGroupMock ('test0 ' ),
422431 $ this ->getGroupMock ('test1 ' )
423432 ],
424433 [],
@@ -480,7 +489,7 @@ function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration
480489 }
481490 );
482491
483- if ( count ( $ groupsBlockList) > 0 ) {
492+ if ( $ groupsBlockList != [] ) {
484493 /** setup blocked groups list */
485494 $ appConfig = $ this ->createMock (IAppConfig::class);
486495 $ appConfig ->method ('getValueArray ' )
@@ -526,4 +535,4 @@ function ($appName, $key, $default) use ($shareWithGroupOnly, $shareeEnumeration
526535 }
527536 $ this ->assertSame ($ reachedEnd , $ moreResults );
528537 }
529- }
538+ }
0 commit comments