Skip to content

Commit

Permalink
Merge pull request PrestaShop#1065 from tblivet/fix/assets-path
Browse files Browse the repository at this point in the history
[NEW UI] Fix assets path
  • Loading branch information
Quetzacoalt91 authored Dec 4, 2024
2 parents 0c8863e + 6bb0aa1 commit 5166761
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion classes/Twig/AssetsEnvironment.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,6 @@ private function getShopUrlFromRequest(Request $request): string

$path = array_splice($path, 0, -$numberOfSubDirs);

return $request->getSchemeAndHttpHost() . implode('/', $path);
return implode('/', $path);
}
}
8 changes: 4 additions & 4 deletions tests/unit/Twig/AssetsEnvironmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function testGetAssetsBaseUrlReturnsDevUrlInDevMode()

public function testGetAssetsBaseUrlReturnsProductionUrl()
{
$expectedUrl = 'http://localhost/modules/autoupgrade/views';
$expectedUrl = '/modules/autoupgrade/views';
$server = [
'HTTP_HOST' => 'localhost',
'SERVER_PORT' => '80',
Expand Down Expand Up @@ -100,7 +100,7 @@ public function testGetAssetsBaseUrlReturnsProductionUrlWithShopInSubFolder()

$request = new Request([], [], [], [], [], $server);

$expectedUrl = 'http://localhost/hello-world/modules/autoupgrade/views';
$expectedUrl = '/hello-world/modules/autoupgrade/views';
$this->assertSame($expectedUrl, $this->assetsEnvironment->getAssetsBaseUrl($request));
}

Expand All @@ -117,7 +117,7 @@ public function testGetAssetsBaseUrlReturnsProductionUrlWithCustomEntrypoint()

$request = new Request([], [], [], [], [], $server);

$expectedUrl = 'http://localhost/modules/autoupgrade/views';
$expectedUrl = '/modules/autoupgrade/views';
$this->assertSame($expectedUrl, $this->assetsEnvironment->getAssetsBaseUrl($request));
}

Expand All @@ -134,7 +134,7 @@ public function testGetAssetsBaseUrlReturnsProductionUrlWithShopInSubFolderAndPa

$request = new Request([], [], [], [], [], $server);

$expectedUrl = 'http://localhost/hello-world/modules/autoupgrade/views';
$expectedUrl = '/hello-world/modules/autoupgrade/views';
$this->assertSame($expectedUrl, $this->assetsEnvironment->getAssetsBaseUrl($request));
}
}

0 comments on commit 5166761

Please sign in to comment.