From c40a10a07133f014d6dfd3a011925ebfb0be51fb Mon Sep 17 00:00:00 2001 From: Alex Bilbie Date: Thu, 10 Mar 2016 12:40:28 -0500 Subject: [PATCH] Applied fixes from StyleCI --- tests/Grant/ImplicitGrantTest.php | 2 +- tests/Middleware/ResourceServerMiddlewareTest.php | 2 +- tests/ResponseTypes/BearerResponseTypeTest.php | 3 +-- tests/ServerTest.php | 1 - tests/Stubs/StubResponseType.php | 3 ++- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/Grant/ImplicitGrantTest.php b/tests/Grant/ImplicitGrantTest.php index 592d0df0..85371d82 100644 --- a/tests/Grant/ImplicitGrantTest.php +++ b/tests/Grant/ImplicitGrantTest.php @@ -44,7 +44,7 @@ class ImplicitGrantTest extends \PHPUnit_Framework_TestCase [], [], [ - 'response_type' => 'token' + 'response_type' => 'token', ] ); diff --git a/tests/Middleware/ResourceServerMiddlewareTest.php b/tests/Middleware/ResourceServerMiddlewareTest.php index 37c6287f..590ae438 100644 --- a/tests/Middleware/ResourceServerMiddlewareTest.php +++ b/tests/Middleware/ResourceServerMiddlewareTest.php @@ -35,6 +35,7 @@ class ResourceServerMiddlewareTest extends \PHPUnit_Framework_TestCase new Response(), function () { $this->assertEquals('test', func_get_args()[0]->getAttribute('oauth_access_token_id')); + return func_get_args()[1]; } ); @@ -69,5 +70,4 @@ class ResourceServerMiddlewareTest extends \PHPUnit_Framework_TestCase $this->assertEquals(401, $response->getStatusCode()); } - } diff --git a/tests/ResponseTypes/BearerResponseTypeTest.php b/tests/ResponseTypes/BearerResponseTypeTest.php index b5ca3ebb..b0c35fc6 100644 --- a/tests/ResponseTypes/BearerResponseTypeTest.php +++ b/tests/ResponseTypes/BearerResponseTypeTest.php @@ -10,7 +10,6 @@ use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; use League\OAuth2\Server\ResponseTypes\BearerTokenResponse; use Psr\Http\Message\ResponseInterface; -use Zend\Diactoros\Request; use Zend\Diactoros\Response; use Zend\Diactoros\ServerRequest; @@ -136,7 +135,7 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase $json = json_decode($response->getBody()->getContents()); $request = new ServerRequest(); - $request = $request->withHeader('authorization', sprintf('Bearer %s', $json->access_token.'foo')); + $request = $request->withHeader('authorization', sprintf('Bearer %s', $json->access_token . 'foo')); try { $responseType->determineAccessTokenInHeader($request); diff --git a/tests/ServerTest.php b/tests/ServerTest.php index 2251258a..38850ec8 100644 --- a/tests/ServerTest.php +++ b/tests/ServerTest.php @@ -15,7 +15,6 @@ use League\OAuth2\Server\Repositories\UserRepositoryInterface; use League\OAuth2\Server\ResponseTypes\BearerTokenResponse; use League\OAuth2\Server\Server; use LeagueTests\Stubs\StubResponseType; -use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Zend\Diactoros\ServerRequest; diff --git a/tests/Stubs/StubResponseType.php b/tests/Stubs/StubResponseType.php index 74385303..5be07f62 100644 --- a/tests/Stubs/StubResponseType.php +++ b/tests/Stubs/StubResponseType.php @@ -45,8 +45,9 @@ class StubResponseType extends AbstractResponseType /** * @param ServerRequestInterface $request * - * @return \Psr\Http\Message\ServerRequestInterface * @throws \League\OAuth2\Server\Exception\OAuthServerException + * + * @return \Psr\Http\Message\ServerRequestInterface */ public function determineAccessTokenInHeader(ServerRequestInterface $request) {