fix(tests): Adapt tests to appManager usage

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/50999/head
Côme Chilliet 1 year ago committed by Côme Chilliet
parent 34139987d6
commit e2a4649257
  1. 3
      apps/files/tests/Controller/ViewControllerTest.php
  2. 3
      tests/lib/Route/RouterTest.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);

@ -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'));

Loading…
Cancel
Save