mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-23 05:29:52 +05:30
Improved BearerResponseType test
This commit is contained in:
parent
0216638903
commit
fb1fa71b5d
@ -5,6 +5,7 @@ namespace LeagueTests\ResponseTypes;
|
|||||||
use League\OAuth2\Server\Entities\AccessTokenEntity;
|
use League\OAuth2\Server\Entities\AccessTokenEntity;
|
||||||
use League\OAuth2\Server\Entities\ClientEntity;
|
use League\OAuth2\Server\Entities\ClientEntity;
|
||||||
use League\OAuth2\Server\Entities\RefreshTokenEntity;
|
use League\OAuth2\Server\Entities\RefreshTokenEntity;
|
||||||
|
use League\OAuth2\Server\Entities\ScopeEntity;
|
||||||
use League\OAuth2\Server\Exception\OAuthServerException;
|
use League\OAuth2\Server\Exception\OAuthServerException;
|
||||||
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
use League\OAuth2\Server\Repositories\AccessTokenRepositoryInterface;
|
||||||
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
use League\OAuth2\Server\ResponseTypes\BearerTokenResponse;
|
||||||
@ -28,10 +29,14 @@ class BearerResponseTypeTest extends \PHPUnit_Framework_TestCase
|
|||||||
$client = new ClientEntity();
|
$client = new ClientEntity();
|
||||||
$client->setIdentifier('clientName');
|
$client->setIdentifier('clientName');
|
||||||
|
|
||||||
|
$scope = new ScopeEntity();
|
||||||
|
$scope->setIdentifier('basic');
|
||||||
|
|
||||||
$accessToken = new AccessTokenEntity();
|
$accessToken = new AccessTokenEntity();
|
||||||
$accessToken->setIdentifier('abcdef');
|
$accessToken->setIdentifier('abcdef');
|
||||||
$accessToken->setExpiryDateTime((new \DateTime())->add(new \DateInterval('PT1H')));
|
$accessToken->setExpiryDateTime((new \DateTime())->add(new \DateInterval('PT1H')));
|
||||||
$accessToken->setClient($client);
|
$accessToken->setClient($client);
|
||||||
|
$accessToken->addScope($scope);
|
||||||
|
|
||||||
$refreshToken = new RefreshTokenEntity();
|
$refreshToken = new RefreshTokenEntity();
|
||||||
$refreshToken->setIdentifier('abcdef');
|
$refreshToken->setIdentifier('abcdef');
|
||||||
|
Loading…
Reference in New Issue
Block a user