fix(tests): Adapt tests to appManager usage

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-02-24 16:23:21 +01:00 committed by Côme Chilliet
parent 34139987d6
commit e2a4649257
2 changed files with 6 additions and 0 deletions

View file

@ -94,6 +94,9 @@ class ViewControllerTest extends TestCase {
$this->appManager->expects($this->any())
->method('getAppPath')
->willReturnCallback(fn (string $appid): string => \OC::$SERVERROOT . '/apps/' . $appid);
$this->appManager->expects($this->any())
->method('isAppLoaded')
->willReturn(true);
$this->cacheFactory = $this->createMock(ICacheFactory::class);
$this->logger = $this->createMock(LoggerInterface::class);

View file

@ -63,6 +63,9 @@ class RouterTest extends TestCase {
$this->appManager->expects(self::atLeastOnce())
->method('getAppPath')
->willReturnCallback(fn (string $appid): string => \OC::$SERVERROOT . '/apps/' . $appid);
$this->appManager->expects(self::atLeastOnce())
->method('isAppLoaded')
->willReturn(true);
$this->assertEquals('/index.php/apps/files/', $this->router->generate('files.view.index'));