Support the ongoing development of Laravel.io →
Authentication Testing
Last updated 2 years ago.
0

Dammit, so obvious. Yep that worked! Thanks DrPrez

Last updated 2 years ago.
0

So obvious someone erased the answer? But not so obvious that the answer is easily discoverable.

0

thomasedwards said:

Dammit, so obvious. Yep that worked! Thanks DrPrez

Looks like the answer was deleted.....could you post it for us?

0

You could just ensure that you log out the user before each test case - possibly with $this->flushSession() as found in Illuminate\Foundation\Testing\Concerns\InteractsWithSession.

However do each test cases not get executed separately from one another? If so using $this->be(...) with-in one test case shouldn't result in the user still being logged in on the next test case.

0
Auth::logout();

Was the original answer. Archive.org saves the day.

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.