On 10/23/10 9:02 PM, Lukas Kahwe Smith wrote:
On 23.10.2010, at 17:21, Fabien Potencier<[email protected]>
wrote:
On 10/23/10 10:54 AM, Lukas Kahwe Smith wrote:
Hi,
I am trying to create a functional test to a controller and pass a GET
parameter along:
$client = $this->createClient(array('environment' => 'test'));
$client->request('GET', '/foo?ding=dong');
$this->assertContains('dong, $client->getResponse()->getContent());
However when I then do something like the following in my controller:
$content = $this->request->query->get('foo', 'nofoo');
$this->response->setContent($content);
return $this->response;
That's weird. I have just tested this code:
$client->request('GET', '/foo?foo=bar');
die(var_export($client->getRequest()->query->all()));
And the output is:
RuntimeException: array (
'foo' => 'bar',
)
as expected.
yeah. but my testing showed that un the controller the request parameter is not available
even though i am using the "request" service
Do you use a recent version of Symfony2? Because I have fixed a bug a
week or two ago that should have fixed your problem.
Fabien
Lukas
--
If you want to report a vulnerability issue on symfony, please send it to
security at symfony-project.com
You received this message because you are subscribed to the Google
Groups "symfony developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-devs?hl=en