2121use OCP \Files \AppData \IAppDataFactory ;
2222use OCP \Http \Client \IClientService ;
2323use OCP \IConfig ;
24+ use OCP \IGroup ;
25+ use OCP \IGroupManager ;
2426use OCP \IL10N ;
2527use OCP \INavigationManager ;
2628use OCP \IRequest ;
@@ -45,6 +47,7 @@ class AppSettingsControllerTest extends TestCase {
4547 private CategoryFetcher &MockObject $ categoryFetcher ;
4648 private AppFetcher &MockObject $ appFetcher ;
4749 private IFactory &MockObject $ l10nFactory ;
50+ private IGroupManager &MockObject $ groupManager ;
4851 private BundleFetcher &MockObject $ bundleFetcher ;
4952 private Installer &MockObject $ installer ;
5053 private IURLGenerator &MockObject $ urlGenerator ;
@@ -70,6 +73,7 @@ protected function setUp(): void {
7073 $ this ->categoryFetcher = $ this ->createMock (CategoryFetcher::class);
7174 $ this ->appFetcher = $ this ->createMock (AppFetcher::class);
7275 $ this ->l10nFactory = $ this ->createMock (IFactory::class);
76+ $ this ->groupManager = $ this ->createMock (IGroupManager::class);
7377 $ this ->bundleFetcher = $ this ->createMock (BundleFetcher::class);
7478 $ this ->installer = $ this ->createMock (Installer::class);
7579 $ this ->urlGenerator = $ this ->createMock (IURLGenerator::class);
@@ -89,6 +93,7 @@ protected function setUp(): void {
8993 $ this ->categoryFetcher ,
9094 $ this ->appFetcher ,
9195 $ this ->l10nFactory ,
96+ $ this ->groupManager ,
9297 $ this ->bundleFetcher ,
9398 $ this ->installer ,
9499 $ this ->urlGenerator ,
@@ -168,9 +173,16 @@ public function testViewApps(): void {
168173 ->expects ($ this ->once ())
169174 ->method ('setActiveEntry ' )
170175 ->with ('core_apps ' );
176+ $ this ->groupManager ->expects ($ this ->once ())
177+ ->method ('search ' )
178+ ->with ($ this ->equalTo ('' ), $ this ->equalTo (5 ))
179+ ->willReturn ([
180+ $ this ->createMock (IGroup::class),
181+ $ this ->createMock (IGroup::class),
182+ ]);
171183
172184 $ this ->initialState
173- ->expects ($ this ->exactly (3 ))
185+ ->expects ($ this ->exactly (4 ))
174186 ->method ('provideInitialState ' );
175187
176188 $ policy = new ContentSecurityPolicy ();
@@ -201,9 +213,16 @@ public function testViewAppsAppstoreNotEnabled(): void {
201213 ->expects ($ this ->once ())
202214 ->method ('setActiveEntry ' )
203215 ->with ('core_apps ' );
216+ $ this ->groupManager ->expects ($ this ->once ())
217+ ->method ('search ' )
218+ ->with ($ this ->equalTo ('' ), $ this ->equalTo (5 ))
219+ ->willReturn ([
220+ $ this ->createMock (IGroup::class),
221+ $ this ->createMock (IGroup::class),
222+ ]);
204223
205224 $ this ->initialState
206- ->expects ($ this ->exactly (3 ))
225+ ->expects ($ this ->exactly (4 ))
207226 ->method ('provideInitialState ' );
208227
209228 $ policy = new ContentSecurityPolicy ();
0 commit comments