From e2a46492577e95ad5d790befaa62d74eb2393b87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Mon, 24 Feb 2025 16:23:21 +0100 Subject: [PATCH] fix(tests): Adapt tests to appManager usage MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- apps/files/tests/Controller/ViewControllerTest.php | 3 +++ tests/lib/Route/RouterTest.php | 3 +++ 2 files changed, 6 insertions(+) diff --git a/apps/files/tests/Controller/ViewControllerTest.php b/apps/files/tests/Controller/ViewControllerTest.php index 56cc7d7c6f8..dd76e814054 100644 --- a/apps/files/tests/Controller/ViewControllerTest.php +++ b/apps/files/tests/Controller/ViewControllerTest.php @@ -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); diff --git a/tests/lib/Route/RouterTest.php b/tests/lib/Route/RouterTest.php index 6f253d9121f..f99ebe4767f 100644 --- a/tests/lib/Route/RouterTest.php +++ b/tests/lib/Route/RouterTest.php @@ -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'));