Welcome Guest, Not a member yet? Register   Sign In
Feature Tests and Session

Currently, running a Feature Test will start with a fresh Session when you make the call(). While this helps ensure that each test is “fresh” it means you cannot prep anything in the Session l, such as logging a user in. FeatureTest has withSession to help with this but not any means of handling at the test case level. This means, for example, if you were testing a controller that required authentication you would need to pass the same Auth session data in on every test. 

Has anyone used Feature Tests? If so how would you like to see session data handled?

Note, here is the line in question on FeatureTestTrait, mostly for my reference:
$_SESSION = $this->session ?? [];

Theme © iAndrew 2016 - Forum software by © MyBB