Fix to broken methods

This commit is contained in:
Alex Bilbie 2016-04-10 10:28:12 +01:00
parent b7064befe4
commit 5410a42bb6
9 changed files with 20 additions and 20 deletions

View File

@ -21,7 +21,7 @@ class ClientCredentialsGrant extends AbstractGrant
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function respondToRequest( public function respondToAccessTokenRequest(
ServerRequestInterface $request, ServerRequestInterface $request,
ResponseTypeInterface $responseType, ResponseTypeInterface $responseType,
\DateInterval $accessTokenTTL \DateInterval $accessTokenTTL

View File

@ -47,7 +47,7 @@ interface GrantTypeInterface extends EmitterAwareInterface
* *
* @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface * @return \League\OAuth2\Server\ResponseTypes\ResponseTypeInterface
*/ */
public function respondToRequest( public function respondToAccessTokenRequest(
ServerRequestInterface $request, ServerRequestInterface $request,
ResponseTypeInterface $responseType, ResponseTypeInterface $responseType,
\DateInterval $accessTokenTTL \DateInterval $accessTokenTTL

View File

@ -41,7 +41,7 @@ class PasswordGrant extends AbstractGrant
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function respondToRequest( public function respondToAccessTokenRequest(
ServerRequestInterface $request, ServerRequestInterface $request,
ResponseTypeInterface $responseType, ResponseTypeInterface $responseType,
\DateInterval $accessTokenTTL \DateInterval $accessTokenTTL

View File

@ -34,7 +34,7 @@ class RefreshTokenGrant extends AbstractGrant
/** /**
* {@inheritdoc} * {@inheritdoc}
*/ */
public function respondToRequest( public function respondToAccessTokenRequest(
ServerRequestInterface $request, ServerRequestInterface $request,
ResponseTypeInterface $responseType, ResponseTypeInterface $responseType,
\DateInterval $accessTokenTTL \DateInterval $accessTokenTTL

View File

@ -250,7 +250,7 @@ class AbstractGrantTest extends \PHPUnit_Framework_TestCase
'grant_type' => 'foobar', 'grant_type' => 'foobar',
]); ]);
$this->assertTrue($grantMock->canRespondToRequest($serverRequest)); $this->assertTrue($grantMock->canRespondToAccessTokenRequest($serverRequest));
} }
public function testIssueRefreshToken() public function testIssueRefreshToken()

View File

@ -47,7 +47,7 @@ class ClientCredentialsGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface); $this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
} }

View File

@ -65,7 +65,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface); $this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface); $this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
@ -99,7 +99,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -131,7 +131,7 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -165,6 +165,6 @@ class PasswordGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
} }

View File

@ -91,7 +91,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface); $this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface); $this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
@ -148,7 +148,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
$this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface); $this->assertTrue($responseType->getAccessToken() instanceof AccessTokenEntityInterface);
$this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface); $this->assertTrue($responseType->getRefreshToken() instanceof RefreshTokenEntityInterface);
@ -207,7 +207,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -239,7 +239,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -274,7 +274,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -324,7 +324,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -370,7 +370,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
/** /**
@ -417,6 +417,6 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
); );
$responseType = new StubResponseType(); $responseType = new StubResponseType();
$grant->respondToRequest($serverRequest, $responseType, new \DateInterval('PT5M')); $grant->respondToAccessTokenRequest($serverRequest, $responseType, new \DateInterval('PT5M'));
} }
} }

View File

@ -5,14 +5,14 @@ namespace LeagueTests\ResponseTypes;
use League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator; use League\OAuth2\Server\AuthorizationValidators\BearerTokenValidator;
use League\OAuth2\Server\Exception\OAuthServerException; use League\OAuth2\Server\Exception\OAuthServerException;
useLeagueTestsLeague\OAuth2\Server\CryptKey; use League\OAuth2\Server\CryptKey;
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface; use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse; use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
use LeagueTests\Stubs\ClientEntity; use LeagueTests\Stubs\ClientEntity;
use LeagueTests\Stubs\RefreshTokenEntity; use LeagueTests\Stubs\RefreshTokenEntity;
use LeagueTests\Stubs\ScopeEntity; use LeagueTests\Stubs\ScopeEntity;
use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\ResponseInterface;
use Stubs\AccessTokenEntity; use LeagueTests\Stubs\AccessTokenEntity;
use Zend\Diactoros\Response; use Zend\Diactoros\Response;
use Zend\Diactoros\ServerRequest; use Zend\Diactoros\ServerRequest;