Symfony2 Functonal Tests, query parameters are ignored

293 views Asked by At

How do I send additional parameters with a request in a functional test in Symfony2. I have

$client = static::createClient();
$crawler = $client->request("GET", '/timezones/23.html?X=1', array("rest_auth" => "wrong"));

Both X and rest_auth are missing when the request hits my Symfony2 application. I have tried it with POST too and even with

json_encode(array("rest_auth" => "wrong"))

Nothing seems to work in sending additional query parameters to the request.

1

There are 1 answers

0
Jake N On

It turns out that this will work for the passed params

$req->get("timezone")

But this will not

$_REQUEST['timezone']
$_GET['timezone']