Closed
Description
Symfony version(s) affected: 5.2.0
Description
#37272 introduced better handling for dots in query strings by no longer converting them to underscores.
Unfortunately, there are now different results when running this via unit tests or the browser.
How to reproduce
Controller
public function index(Request $request)
{
return new JsonResponse($request->query->all());
}
Test
public function testIndex(): void
{
$client = static::createClient();
$client->request('GET', '/en/blog/?bla.one=testing');
$this->assertSame(
json_decode($client->getResponse()->getContent(), true),
[
'bla.one' => 'testing',
]
);
}
The test passes, but when running it via a browser (using symfony serve)
(Both return the same when using 5.1)
Further detail
Going via the web calls Request::createFromGlobals()
, but unit tests call Request::create()
(which calls the changed parseQuery).
Replaces laravel/framework#35616