-
Notifications
You must be signed in to change notification settings - Fork 180
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
How to set some data in session in functional test? #414
Comments
Someone had the same question in #383. I think that the test should follow the same path than the one used by visitors. So you'll test that the data is wrote in session and readen later. |
I think the main mistake here is forgetting that |
@Jean85 Do you remember if |
@alexislefebvre yes you get a real container, but it's not the same instance as |
@shubaivan Did you try to use the client's container? It may work with something like this: $client = $this->makeClient();
$client->getContainer()->set('test', 2);
$crawler = $client->request('GET', '/contact'); |
I'm closing this issue for now. Feel free to reopen it if the problem is not solved. |
I use
"liip/functional-test-bundle": "~1.8",
and"symfony/symfony": "~3.4",
and for my functional test I want set some data in session,but after set data in action, with the same key, I had null. Mytest class extends fromextends WebTestCase
this is how I set data in test method
config_test.yml
and in action
variable
$test
equal nullHow to set some data in session in functional test ?
The text was updated successfully, but these errors were encountered: