@@ -148,6 +148,12 @@ public function testAddClosure(array $entry, array $expectedEntry): void {
148148 global $ testAddClosureNumberOfCalls ;
149149 $ testAddClosureNumberOfCalls = 0 ;
150150
151+ $ this ->appManager ->expects ($ this ->atLeastOnce ())
152+ ->method ('isAppLoaded ' )
153+ ->willReturnMap ([
154+ ['files ' , true ],
155+ ]);
156+
151157 $ this ->navigationManager ->add (function () use ($ entry ) {
152158 global $ testAddClosureNumberOfCalls ;
153159 $ testAddClosureNumberOfCalls ++;
@@ -235,8 +241,10 @@ public function testWithAppManager($expected, $navigation, $isAdmin = false): vo
235241 ->willReturn ($ navigation );
236242 $ this ->appManager ->expects ($ this ->any ())
237243 ->method ('isAppLoaded ' )
238- ->with ('test ' )
239- ->willReturn (true );
244+ ->willReturnMap ([
245+ ['test ' , true ],
246+ ['files ' , true ],
247+ ]);
240248 $ this ->urlGenerator ->expects ($ this ->any ())
241249 ->method ('imagePath ' )
242250 ->willReturnCallback (function ($ appName , $ file ) {
@@ -431,9 +439,20 @@ function (string $userId, string $appName, string $key, mixed $default = '') use
431439 ->method ('isEnabledForUser ' )
432440 ->with ('theming ' )
433441 ->willReturn (true );
434- $ this ->appManager ->expects ($ this ->once ())->method ('getAppInfo ' )->with ('test ' )->willReturn ($ navigation );
435- $ this ->appManager ->expects ($ this ->any ())->method ('isAppLoaded ' )->with ('test ' )->willReturn (true );
436- $ this ->appManager ->expects ($ this ->once ())->method ('getAppIcon ' )->with ('test ' )->willReturn ('/apps/test/img/app.svg ' );
442+ $ this ->appManager ->expects ($ this ->once ())
443+ ->method ('getAppIcon ' )
444+ ->with ('test ' )
445+ ->willReturn ('/apps/test/img/app.svg ' );
446+ $ this ->appManager ->expects ($ this ->once ())
447+ ->method ('getAppInfo ' )
448+ ->with ('test ' )
449+ ->willReturn ($ navigation );
450+ $ this ->appManager ->expects ($ this ->atLeastOnce ())
451+ ->method ('isAppLoaded ' )
452+ ->willReturnMap ([
453+ ['test ' , true ],
454+ ['files ' , true ],
455+ ]);
437456 $ this ->l10nFac ->expects ($ this ->any ())->method ('get ' )->willReturn ($ l );
438457 $ this ->urlGenerator ->expects ($ this ->any ())->method ('imagePath ' )->willReturnCallback (function ($ appName , $ file ) {
439458 return "/apps/ $ appName/img/ $ file " ;
@@ -635,7 +654,13 @@ public function testGetDefaultEntryIdForUser(string $defaultApps, string $userDe
635654 ];
636655 });
637656
638- $ this ->appManager ->method ('getEnabledApps ' )->willReturn ([]);
657+ $ this ->appManager ->method ('getEnabledApps ' )->willReturn (['files ' ]);
658+ $ this ->appManager ->expects ($ this ->atLeastOnce ())
659+ ->method ('isAppLoaded ' )
660+ ->willReturnMap ([
661+ ['test ' , true ],
662+ ['files ' , true ],
663+ ]);
639664
640665 $ user = $ this ->createMock (IUser::class);
641666 $ user ->method ('getUID ' )->willReturn ('user1 ' );
0 commit comments