From bf781ba8836d2e945e8769394b7b5df0bdc6c537 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=B4me=20Chilliet?= Date: Thu, 19 Sep 2024 17:41:24 +0200 Subject: [PATCH] fix: Remove references to getLogger and ILogger in the tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Côme Chilliet --- .../Unit/Controller/PublicFavoritePageControllerTest.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/Unit/Controller/PublicFavoritePageControllerTest.php b/tests/Unit/Controller/PublicFavoritePageControllerTest.php index fa9871352..74846c047 100644 --- a/tests/Unit/Controller/PublicFavoritePageControllerTest.php +++ b/tests/Unit/Controller/PublicFavoritePageControllerTest.php @@ -33,6 +33,7 @@ use OCP\AppFramework\IAppContainer; use OCP\IServerContainer; use PHPUnit\Framework\TestCase; +use Psr\Log\LoggerInterface; class PublicFavoritePageControllerTest extends TestCase { /* @var PublicFavoritePageController */ @@ -54,7 +55,7 @@ class PublicFavoritePageControllerTest extends TestCase { protected function setUp(): void { // Begin transaction - $db = OC::$server->query(\OCP\IDBConnection::class); + $db = \OCP\Server::get(\OCP\IDBConnection::class); $db->beginTransaction(); $this->app = new Application(); @@ -62,10 +63,10 @@ protected function setUp(): void { $this->container = $this->app->getContainer(); $container = $this->container; - $appName = $container->query('AppName'); + $appName = $container->query('appName'); $this->favoritesService = new FavoritesService( - $container->query(IServerContainer::class)->getLogger(), + $container->query(IServerContainer::class)->get(LoggerInterface::class), $container->query(IServerContainer::class)->getL10N($appName), $container->query(IServerContainer::class)->getSecureRandom(), $container->query(\OCP\IDBConnection::class) @@ -87,7 +88,7 @@ protected function setUp(): void { $requestMock, $sessionMock, $this->config, - $container->query(\OCP\ILogger::class), + $container->query(LoggerInterface::class), $this->favoriteShareMapper ); }