Skip to content

Commit

Permalink
Merge pull request #118 from dominic-ks/update-obselete-test-codes
Browse files Browse the repository at this point in the history
update expected codes in test
  • Loading branch information
dominic-ks committed May 8, 2024
2 parents adc374c + 8db6381 commit f99ca5a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/src/RefreshTokenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
}
Expand Down Expand Up @@ -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']);
}
Expand Down Expand Up @@ -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']);
}

/**
Expand Down Expand Up @@ -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']);
}
Expand Down

0 comments on commit f99ca5a

Please sign in to comment.