mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-22 13:09:44 +05:30
Fix the refresh token grant test
This commit is contained in:
parent
24f29b6382
commit
f9143b5163
@ -49,6 +49,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$scopeRepositoryMock = $this->getMockBuilder(ScopeRepositoryInterface::class)->getMock();
|
||||
$scopeEntity = new ScopeEntity();
|
||||
$scopeEntity->setIdentifier(self::DEFAULT_SCOPE);
|
||||
$scopeRepositoryMock->method('getScopeEntityByIdentifier')->willReturn($scopeEntity);
|
||||
|
||||
$accessTokenRepositoryMock = $this->getMockBuilder(AccessTokenRepositoryInterface::class)->getMock();
|
||||
@ -63,10 +64,6 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
||||
->expects($this->once())
|
||||
->method('persistNewRefreshToken')->willReturnSelf();
|
||||
|
||||
$oldRefreshTokenCheckResult = ['scopes' => $scopeEntity->getIdentifier()];
|
||||
|
||||
$refreshTokenRepositoryMock->method('validateOldRefreshToken')->willReturn($oldRefreshTokenCheckResult);
|
||||
|
||||
$grant = new RefreshTokenGrant($refreshTokenRepositoryMock);
|
||||
$grant->setClientRepository($clientRepositoryMock);
|
||||
$grant->setScopeRepository($scopeRepositoryMock);
|
||||
@ -81,7 +78,7 @@ class RefreshTokenGrantTest extends \PHPUnit_Framework_TestCase
|
||||
'client_id' => 'foo',
|
||||
'refresh_token_id' => 'zyxwvu',
|
||||
'access_token_id' => 'abcdef',
|
||||
'scopes' => ['foo'],
|
||||
'scopes' => [self::DEFAULT_SCOPE],
|
||||
'user_id' => 123,
|
||||
'expire_time' => time() + 3600,
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user