framework: Session store not set on request.

There is a problem during unit testing when Input::old() is being called. It then throws an RuntimeException("Session store not set on request."); I am not sure what is the reason of that, but the problem exists in both Laravel 4.2 and 5.1. Is that bug or something that was intended and if so what is the solution to fix this besides of checking App::isRunningUnitTests() which I would rather like to avoid ? Session driver in config is set to array.

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 17 (7 by maintainers)

Most upvoted comments

The solution I used in my case was setting session to request manually in setUp method of PHPUnit. Like $this->app['request']->setSession($this->app['session']->driver('array')); Not sure if that’s the best solution, it worked for me, still not optimal as it should be handled by framework I believe.