1
0
Fork 0
mirror of https://github.com/archtechx/tenancy.git synced 2026-06-20 22:54:05 +00:00

minor test improvements

This commit is contained in:
Samuel Stancl 2026-06-05 13:59:58 -07:00
parent 142efdccd6
commit 3e20576dc0
No known key found for this signature in database
GPG key ID: BA146259A1E16C57

View file

@ -225,11 +225,10 @@ test('stopImpersonating logs out the user from the impersonation guard stored in
'provider' => 'users',
]]);
// Switch guard from 'web' to 'test' and manually log in the user through 'test'
auth()->shouldUse('test');
auth()->loginUsingId($user->id);
// Manually log the user in through the 'test' guard
auth('test')->loginUsingId($user->id);
// Should log out the user from the guard used for impersonation ('web')
// Should log the user out from the guard used for impersonation ('web')
UserImpersonation::stopImpersonating();
expect(auth('web')->check())->toBeFalse();
@ -241,7 +240,7 @@ test('stopImpersonating logs out the user from the impersonation guard stored in
// stopImpersonating should throw an exception instead of logging out
expect(fn() => UserImpersonation::stopImpersonating())->toThrow(Exception::class);
expect(auth()->check())->toBeTrue();
expect(auth('test')->check())->toBeTrue();
});
test('tokens have a limited ttl', function () {