Fixed: Resolve login from cache
This commit is contained in:
parent
2519d63929
commit
23e0a27f9a
tests/Feature
|
@ -53,6 +53,26 @@ class LoginTest extends TestCase
|
||||||
Http::assertSentCount(2);
|
Http::assertSentCount(2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testItResolvesTheLoginFromTheCache()
|
||||||
|
{
|
||||||
|
$this->withoutExceptionHandling();
|
||||||
|
app('nami.backend')->fakeLogin(123, [], 'cookie-123');
|
||||||
|
|
||||||
|
$this->post('/login', [
|
||||||
|
'mglnr' => 123,
|
||||||
|
'password' => 'secret'
|
||||||
|
]);
|
||||||
|
auth()->setUser(null);
|
||||||
|
$this->post('/login', [
|
||||||
|
'mglnr' => 123,
|
||||||
|
'password' => 'secret'
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->assertTrue(auth()->check());
|
||||||
|
|
||||||
|
Http::assertSentCount(2);
|
||||||
|
}
|
||||||
|
|
||||||
public function testItThrowsExceptionWhenLoginFailed()
|
public function testItThrowsExceptionWhenLoginFailed()
|
||||||
{
|
{
|
||||||
app('nami.backend')->fakeFailedLogin(123);
|
app('nami.backend')->fakeFailedLogin(123);
|
||||||
|
|
Loading…
Reference in New Issue