Skip to content

Commit

Permalink
Update mock of upgrade container
Browse files Browse the repository at this point in the history
  • Loading branch information
Quetzacoalt91 committed Jan 24, 2025
1 parent 049fc74 commit ff6ccf1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/unit/Controller/AbstractGlobalControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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',
Expand Down

0 comments on commit ff6ccf1

Please sign in to comment.