You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I also tried the following: $this->client = $this->makeClient(true); $session = new Session(new MockFileSessionStorage()); $session->set('administration', 12); $this->client->getContainer()->set('session', $session);
This, however doesn't work and seems to just ignore the value. Therefore, my question is how to store values in the session array in a functional test environment?
The text was updated successfully, but these errors were encountered:
I don't have any solution but I'm wondering, how do users set the session? It should be easier to perform the same action that the user do, so it would set the data into the session before you use it.
I'm having a controller which reads an integer from the session array in this manner:
if ($session->has('administration')) { $id = $session->get('entity_id'); return $this->getDoctrine()->getRepository('AppBundle:SomeEntity')->find($id); }
Currently I'm writing tests for this controller action but I can't find how to inject this integer in the sessions array. I tried the following:
$this->client = $this->makeClient(true); $this->client->getContainer()->set('session.storage.options.entity_id', 12);
I also tried the following:
$this->client = $this->makeClient(true); $session = new Session(new MockFileSessionStorage()); $session->set('administration', 12); $this->client->getContainer()->set('session', $session);
This, however doesn't work and seems to just ignore the value. Therefore, my question is how to store values in the session array in a functional test environment?
The text was updated successfully, but these errors were encountered: