diff --git a/app/Repositories/Auth/AuthRepository.php b/app/Repositories/Auth/AuthRepository.php index 45a7ce7..7209983 100644 --- a/app/Repositories/Auth/AuthRepository.php +++ b/app/Repositories/Auth/AuthRepository.php @@ -2,6 +2,7 @@ namespace App\Repositories\Auth; +use Illuminate\Validation\ValidationException; use App\Models\User; use Hash; diff --git a/tests/Feature/Auth/LoginTest.php b/tests/Feature/Auth/LoginTest.php index 4d9b157..d72c492 100644 --- a/tests/Feature/Auth/LoginTest.php +++ b/tests/Feature/Auth/LoginTest.php @@ -26,4 +26,19 @@ class LoginTest extends TestCase $response->assertStatus(200); } + + /** + * A basic feature test example. + */ + public function test_fail(): void + { + $user = User::factory()->create(); + + $response = $this->post('/auth/login',[ + "email" => $user->email, + "password" => "fail", + ]); + + $response->assertStatus(422); + } }