diff --git a/tests/ResponseTypes/BearerResponseTypeTest.php b/tests/ResponseTypes/BearerResponseTypeTest.php index b0c35fc6..de4ac7fa 100644 --- a/tests/ResponseTypes/BearerResponseTypeTest.php +++ b/tests/ResponseTypes/BearerResponseTypeTest.php @@ -95,7 +95,7 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase $request = new ServerRequest(); $request = $request->withHeader('authorization', sprintf('Bearer %s', $json->access_token)); - $request = $responseType->determineAccessTokenInHeader($request); + $request = $responseType->validateAccessToken($request); $this->assertEquals('abcdef', $request->getAttribute('oauth_access_token_id')); $this->assertEquals('clientName', $request->getAttribute('oauth_client_id')); @@ -138,7 +138,7 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase $request = $request->withHeader('authorization', sprintf('Bearer %s', $json->access_token . 'foo')); try { - $responseType->determineAccessTokenInHeader($request); + $responseType->validateAccessToken($request); } catch (OAuthServerException $e) { $this->assertEquals( 'Access token could not be verified', @@ -184,7 +184,7 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase $request = $request->withHeader('authorization', sprintf('Bearer %s', $json->access_token)); try { - $responseType->determineAccessTokenInHeader($request); + $responseType->validateAccessToken($request); } catch (OAuthServerException $e) { $this->assertEquals( 'Access token has been revoked', @@ -207,7 +207,7 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase $request = $request->withHeader('authorization', 'Bearer blah'); try { - $responseType->determineAccessTokenInHeader($request); + $responseType->validateAccessToken($request); } catch (OAuthServerException $e) { $this->assertEquals( 'The JWT string must have two dots', diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 38850ec8..74d88740 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -131,7 +131,7 @@ class ServerTest extends \PHPUnit_Framework_TestCase ); try { - $server->validateRequest(new ServerRequest()); + $server->validateAuthenticatedRequest(new ServerRequest()); } catch (OAuthServerException $e) { $this->assertEquals('Missing "Authorization" header', $e->getHint()); } diff --git a/tests/Stubs/StubResponseType.php b/tests/Stubs/StubResponseType.php index 5be07f62..04e09d62 100644 --- a/tests/Stubs/StubResponseType.php +++ b/tests/Stubs/StubResponseType.php @@ -49,7 +49,7 @@ class StubResponseType extends AbstractResponseType * * @return \Psr\Http\Message\ServerRequestInterface */ - public function determineAccessTokenInHeader(ServerRequestInterface $request) + public function validateAccessToken(ServerRequestInterface $request) { if ($request->getHeader('authorization')[0] === 'Basic test') { return $request->withAttribute('oauth_access_token_id', 'test');