New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Overriding test.client.parameters for HTTP_HOST does not work with WebTestCase #12189
Comments
any progress? |
should be fixed by #16265 |
Does anyone face the same problem with other parameters?
|
That's still an issue when using a default WebTestCase:
The config works and in the BUT, WebTestCase overrides it: https://github.com/symfony/symfony/blob/v3.4.45/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php#L45 And that forces me to override WebTestCase and set proper host manually instead of depending on config. Possible solution: #20535 – it was a good one – overriding just the parameters that are needed, not all of them. There was a concern about BC, but it can be handled: #20535 (comment) I can make a new PR if this is acceptable solution. |
Where should I add test for that? |
Hi,
I've tried to override the test client
HTTP_HOST
server param in my app config:However, in functional tests (WebTestCase),
$client->getServerParameter('HTTP_HOST')
does not returnsymfony.com
but the defaultlocalhost
.The client is actually correctly configured at
symfony/src/Symfony/Bundle/FrameworkBundle/Test/WebTestCase.php
Line 35 in cf3cd95
but the call on the next line
$client->setServerParameters($server);
with an empty array erasesHTTP_HOST
because of the method definition:symfony/src/Symfony/Component/BrowserKit/Client.php
Lines 113 to 119 in cf3cd95
The text was updated successfully, but these errors were encountered: