Skip to content
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

[9.x] Start session in TestResponse to allow marshalling of error bag from JSON #42710

Conversation

Krisell
Copy link
Contributor

@Krisell Krisell commented Jun 8, 2022

When using 'session.serialization' => 'json' the ViewErrorBag content is saved as an array and rebuilt when the session data is loaded. In TestResponse the start() method on the session Store was never called, causing the issue discovered by @tanthammar in #42494

This PR adds a $this->session()->start() call in TestResponse unless the session is already started (i.e. once). The added test fails with Error: Call to a member function getBag() on array without the implementation change.

Related to #42090 and #40595

@Krisell Krisell changed the title Start session in TestResponse to allow marshalling of error bag from JSON [9.x] Start session in TestResponse to allow marshalling of error bag from JSON Jun 8, 2022
@Krisell Krisell changed the title [9.x] Start session in TestResponse to allow marshalling of error bag from JSON [9.x] Start session in TestResponse to allow marshalling of error bag from JSON Jun 8, 2022
@taylorotwell taylorotwell merged commit 1a2e484 into laravel:9.x Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants