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 ;
@@ -46,6 +48,7 @@ class AppSettingsControllerTest extends TestCase {
4648 private CategoryFetcher &MockObject $ categoryFetcher ;
4749 private AppFetcher &MockObject $ appFetcher ;
4850 private IFactory &MockObject $ l10nFactory ;
51+ private IGroupManager &MockObject $ groupManager ;
4952 private BundleFetcher &MockObject $ bundleFetcher ;
5053 private Installer &MockObject $ installer ;
5154 private IURLGenerator &MockObject $ urlGenerator ;
@@ -71,6 +74,7 @@ protected function setUp(): void {
7174 $ this ->categoryFetcher = $ this ->createMock (CategoryFetcher::class);
7275 $ this ->appFetcher = $ this ->createMock (AppFetcher::class);
7376 $ this ->l10nFactory = $ this ->createMock (IFactory::class);
77+ $ this ->groupManager = $ this ->createMock (IGroupManager::class);
7478 $ this ->bundleFetcher = $ this ->createMock (BundleFetcher::class);
7579 $ this ->installer = $ this ->createMock (Installer::class);
7680 $ this ->urlGenerator = $ this ->createMock (IURLGenerator::class);
@@ -90,6 +94,7 @@ protected function setUp(): void {
9094 $ this ->categoryFetcher ,
9195 $ this ->appFetcher ,
9296 $ this ->l10nFactory ,
97+ $ this ->groupManager ,
9398 $ this ->bundleFetcher ,
9499 $ this ->installer ,
95100 $ this ->urlGenerator ,
@@ -169,9 +174,16 @@ public function testViewApps(): void {
169174 ->expects ($ this ->once ())
170175 ->method ('setActiveEntry ' )
171176 ->with ('core_apps ' );
177+ $ this ->groupManager ->expects ($ this ->once ())
178+ ->method ('search ' )
179+ ->with ($ this ->equalTo ('' ), $ this ->equalTo (5 ))
180+ ->willReturn ([
181+ $ this ->createMock (IGroup::class),
182+ $ this ->createMock (IGroup::class),
183+ ]);
172184
173185 $ this ->initialState
174- ->expects ($ this ->exactly (4 ))
186+ ->expects ($ this ->exactly (5 ))
175187 ->method ('provideInitialState ' );
176188
177189 $ policy = new ContentSecurityPolicy ();
@@ -202,9 +214,16 @@ public function testViewAppsAppstoreNotEnabled(): void {
202214 ->expects ($ this ->once ())
203215 ->method ('setActiveEntry ' )
204216 ->with ('core_apps ' );
217+ $ this ->groupManager ->expects ($ this ->once ())
218+ ->method ('search ' )
219+ ->with ($ this ->equalTo ('' ), $ this ->equalTo (5 ))
220+ ->willReturn ([
221+ $ this ->createMock (IGroup::class),
222+ $ this ->createMock (IGroup::class),
223+ ]);
205224
206225 $ this ->initialState
207- ->expects ($ this ->exactly (4 ))
226+ ->expects ($ this ->exactly (5 ))
208227 ->method ('provideInitialState ' );
209228
210229 $ policy = new ContentSecurityPolicy ();
0 commit comments