From 6863cd55823c3fa04a51a73d01507cd88d1400a0 Mon Sep 17 00:00:00 2001 From: Aronne Brivio Date: Sun, 21 Mar 2021 18:45:20 +0100 Subject: [PATCH] All auth tests now passing --- tests/AuthTest.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/AuthTest.php b/tests/AuthTest.php index 66d75b9..cf69cdf 100644 --- a/tests/AuthTest.php +++ b/tests/AuthTest.php @@ -28,13 +28,11 @@ public function testLogin() ->seeStatusCode(401); } - /* - * FIXME: doesn't retrieve the token public function testLogout() { - $user = User::factory()->create(); - // $this->actingAs($user); + $this->refreshApplication(); + $user = User::factory()->create(); // NOTE: in order to make logout() function working we have to pass the JWT token -> can't use standard actingAs function $token = JWTAuth::fromUser($user); @@ -45,15 +43,16 @@ public function testLogout() public function testRefresh() { + $this->refreshApplication(); + $user = User::factory()->create(); // NOTE: in order to make logout() function working we have to pass the JWT token -> can't use standard actingAs function $token = JWTAuth::fromUser($user); - $this->post('auth/refresh', [], ['Authorization' => 'Bearer ' . $token]) + $this->json('POST', 'auth/refresh', [], ['Authorization' => 'Bearer ' . $token]) ->seeStatusCode(200) ->seeJson(['token_type' => 'bearer']); } - */ public function testMe() {