mirror of
https://github.com/archtechx/tenancy.git
synced 2026-05-06 19:44:03 +00:00
Rename test and use different current guard
Originally, we just authenticated the user using a different guard, without actually switching to that guard. Now, we fully switch to the 'test' guard.
This commit is contained in:
parent
920cb06d1f
commit
1289550533
1 changed files with 4 additions and 3 deletions
|
|
@ -191,7 +191,7 @@ test('stopImpersonating can keep the user authenticated', function() {
|
|||
->assertSee('You are logged in as Joe');
|
||||
});
|
||||
|
||||
test('stopImpersonating logs out the user from the guard used while starting impersonation', function() {
|
||||
test('stopImpersonating logs out the user from tenancy_impersonation_guard stored in session', function() {
|
||||
Route::middleware(InitializeTenancyByPath::class)->prefix('/{tenant}')->group(getRoutes(false));
|
||||
|
||||
$tenant = Tenant::create([
|
||||
|
|
@ -225,8 +225,9 @@ test('stopImpersonating logs out the user from the guard used while starting imp
|
|||
'provider' => 'users',
|
||||
]]);
|
||||
|
||||
// Manually log in the user using a different guard
|
||||
auth('test')->loginUsingId($user->id);
|
||||
// Switch guard from 'web' to 'test' and manually log in the user through 'test'
|
||||
auth()->shouldUse('test');
|
||||
auth()->loginUsingId($user->id);
|
||||
|
||||
// Should log out the user from the guard used for impersonation ('web')
|
||||
UserImpersonation::stopImpersonating();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue