From f9143b5163deb146def3400014a70a59312a69f6 Mon Sep 17 00:00:00 2001 From: Andrew Millington Date: Mon, 30 Oct 2017 23:26:11 +0000 Subject: [PATCH] Fix the refresh token grant test --- tests/Grant/RefreshTokenGrantTest.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/tests/Grant/RefreshTokenGrantTest.php b/tests/Grant/RefreshTokenGrantTest.php index 514d4c62..dbaf75d1 100644 --- a/tests/Grant/RefreshTokenGrantTest.php +++ b/tests/Grant/RefreshTokenGrantTest.php @@ -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, ]