Skip to content

Commit 938836c

Browse files
committed
Always set the ACCEPT_LANGUAGE header in the functional tests
1 parent 47c14db commit 938836c

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

core-bundle/src/Resources/contao/library/Contao/Environment.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,11 +218,6 @@ protected static function requestUri()
218218
*/
219219
protected static function httpAcceptLanguage()
220220
{
221-
if (empty($_SERVER['HTTP_ACCEPT_LANGUAGE']))
222-
{
223-
return array();
224-
}
225-
226221
$arrAccepted = array();
227222
$arrLanguages = array();
228223

core-bundle/tests/Functional/RoutingTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ public function testResolvesAliases(string $request, int $statusCode, string $pa
5858

5959
$_SERVER['REQUEST_URI'] = $request;
6060
$_SERVER['HTTP_HOST'] = $host;
61+
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en';
6162

6263
$client = $this->createClient([], $_SERVER);
6364
System::setContainer($client->getContainer());
@@ -317,6 +318,7 @@ public function testResolvesAliasesWithLocale(string $request, int $statusCode,
317318

318319
$_SERVER['REQUEST_URI'] = $request;
319320
$_SERVER['HTTP_HOST'] = $host;
321+
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en';
320322

321323
$client = $this->createClient(['environment' => 'locale'], $_SERVER);
322324
System::setContainer($client->getContainer());
@@ -565,6 +567,7 @@ public function testResolvesAliasesWithoutUrlSuffix(string $request, int $status
565567

566568
$_SERVER['REQUEST_URI'] = $request;
567569
$_SERVER['HTTP_HOST'] = $host;
570+
$_SERVER['HTTP_ACCEPT_LANGUAGE'] = 'en';
568571

569572
$client = $this->createClient(['environment' => 'suffix'], $_SERVER);
570573
System::setContainer($client->getContainer());

0 commit comments

Comments
 (0)