Issue
In Laravel feature tests,
Given that user has been programmatically logged in using
$this->actingAs(self::$user, 'api');
How would I logout this user?
actingAs does not accept null as first parameter.
Solution
A good way to logout the user is
$guard = Mockery::mock(Guard::class);
$guard->expects('check')
->andReturns(false);
Auth::shouldReceive('guard')
->andReturns($guard);
Answered By - Florent Brassart Answer Checked By - Senaida (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.