diff --git a/tests/Exception/OAuthServerExceptionTest.php b/tests/Exception/OAuthServerExceptionTest.php index 7ece08032..38b86d433 100644 --- a/tests/Exception/OAuthServerExceptionTest.php +++ b/tests/Exception/OAuthServerExceptionTest.php @@ -137,4 +137,11 @@ public function testCanGetRedirectionUri() $this->assertSame('https://example.com/error', $exceptionWithRedirect->getRedirectUri()); } + + public function testInvalidCredentialsIsInvalidGrant() + { + $exception = OAuthServerException::invalidCredentials(); + + $this->assertSame('invalid_grant', $exception->getErrorType()); + } } diff --git a/tests/Grant/PasswordGrantTest.php b/tests/Grant/PasswordGrantTest.php index 0be3d4826..b53ab2357 100644 --- a/tests/Grant/PasswordGrantTest.php +++ b/tests/Grant/PasswordGrantTest.php @@ -211,7 +211,7 @@ public function testRespondToRequestBadCredentials() $responseType = new StubResponseType(); $this->expectException(\League\OAuth2\Server\Exception\OAuthServerException::class); - $this->expectExceptionCode(10); + $this->expectExceptionCode(6); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new DateInterval('PT5M')); }