From ff6ccf16de1c8719437f66080d7b3494029d18b3 Mon Sep 17 00:00:00 2001 From: Thomas Nabord Date: Fri, 24 Jan 2025 17:38:03 +0000 Subject: [PATCH] Update mock of upgrade container --- tests/unit/Controller/AbstractGlobalControllerTest.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tests/unit/Controller/AbstractGlobalControllerTest.php b/tests/unit/Controller/AbstractGlobalControllerTest.php index 3d94d421c..debe01b62 100644 --- a/tests/unit/Controller/AbstractGlobalControllerTest.php +++ b/tests/unit/Controller/AbstractGlobalControllerTest.php @@ -2,6 +2,7 @@ use PHPUnit\Framework\TestCase; use PrestaShop\Module\AutoUpgrade\Router\Routes; +use PrestaShop\Module\AutoUpgrade\Router\UrlGenerator; use PrestaShop\Module\AutoUpgrade\UpgradeContainer; use Symfony\Component\HttpFoundation\Request; @@ -28,8 +29,12 @@ public function testRedirectTo($destination, $currentUrl, $expectedUrl) { $upgradeContainer = $this->getMockBuilder(UpgradeContainer::class) ->disableOriginalConstructor() + ->setMethods(['getUrlGenerator']) ->getMock(); + $upgradeContainer->method('getUrlGenerator') + ->willReturn(new UrlGenerator('/yo/doge', 'admin-wololo')); + $server = [ 'HTTP_HOST' => 'localhost', 'SERVER_PORT' => '80',