12 lines
416 B
PHP
12 lines
416 B
PHP
<?php
|
|
|
|
it('throttles login after 5 failed attempts', function () {
|
|
$this->withoutMiddleware(\Illuminate\Foundation\Http\Middleware\ValidateCsrfToken::class);
|
|
|
|
for ($i = 0; $i < 5; $i++) {
|
|
$this->post('/login', ['email' => 'test@test.com', 'password' => 'wrong']);
|
|
}
|
|
$response = $this->post('/login', ['email' => 'test@test.com', 'password' => 'wrong']);
|
|
$response->assertStatus(429);
|
|
});
|