From 8db638173a8ecf28960a81ff7cdd5ca7283bcf21 Mon Sep 17 00:00:00 2001 From: Dominic Vermeulen-Smith Date: Tue, 7 May 2024 21:00:00 +0100 Subject: [PATCH] update expected codes in test --- tests/src/RefreshTokenTest.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/src/RefreshTokenTest.php b/tests/src/RefreshTokenTest.php index 2e85edc..04809a7 100644 --- a/tests/src/RefreshTokenTest.php +++ b/tests/src/RefreshTokenTest.php @@ -115,7 +115,7 @@ public function testTokenWithInvalidRefreshToken(string $refreshToken): void { 'cookies' => $cookies, ]); $body = json_decode($response->getBody()->getContents(), true); - $this->assertEquals('jwt_auth_obsolete_token', $body['code']); + $this->assertEquals('jwt_auth_obsolete_refresh_token', $body['code']); $this->assertEquals(401, $response->getStatusCode()); $this->assertEquals(false, $body['success']); } @@ -213,7 +213,7 @@ public function testTokenWithRotatedRefreshToken(): void { $this->setCookie('refresh_token', $refreshToken1, $domain); $response = $this->client->post('/wp-json/jwt-auth/v1/token'); $body = json_decode($response->getBody()->getContents(), true); - $this->assertEquals('jwt_auth_obsolete_token', $body['code']); + $this->assertEquals('jwt_auth_obsolete_refresh_token', $body['code']); $this->assertEquals(401, $response->getStatusCode()); $this->assertEquals(false, $body['success']); } @@ -309,7 +309,7 @@ public function testTokenRefreshRotationByDevice() { ]); $this->assertEquals(401, $response->getStatusCode()); $body = json_decode($response->getBody()->getContents(), true); - $this->assertEquals('jwt_auth_obsolete_token', $body['code']); + $this->assertEquals('jwt_auth_obsolete_refresh_token', $body['code']); } /** @@ -339,7 +339,7 @@ public function testTokenRefreshWithInvalidRefreshToken(string $refreshToken): v 'cookies' => $cookies, ]); $body = json_decode($response->getBody()->getContents(), true); - $this->assertEquals('jwt_auth_obsolete_token', $body['code']); + $this->assertEquals('jwt_auth_obsolete_refresh_token', $body['code']); $this->assertEquals(401, $response->getStatusCode()); $this->assertEquals(false, $body['success']); }