• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Feature Tests and Session

#1
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 ?? [];
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.