-
-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Closed
Description
Hi,
I've tried to override the test client HTTP_HOST
server param in my app config:
parameters:
test.client.parameters:
HTTP_HOST: symfony.com
However, in functional tests (WebTestCase), $client->getServerParameter('HTTP_HOST')
does not return symfony.com
but the default localhost
.
The client is actually correctly configured at
$client = static::$kernel->getContainer()->get('test.client'); |
but the call on the next line $client->setServerParameters($server);
with an empty array erases HTTP_HOST
because of the method definition:
symfony/src/Symfony/Component/BrowserKit/Client.php
Lines 113 to 119 in cf3cd95
public function setServerParameters(array $server) | |
{ | |
$this->server = array_merge(array( | |
'HTTP_HOST' => 'localhost', | |
'HTTP_USER_AGENT' => 'Symfony2 BrowserKit', | |
), $server); | |
} |