Skip to content

Commit 2f62832

Browse files
datappManuel Dimmler
authored andcommitted
Default Scope does not work as expected
resolves issue #1092
1 parent 020faf4 commit 2f62832

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Grant/AbstractGrant.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ public function validateScopes($scopes, $redirectUri = null)
316316
private function convertScopesQueryStringToArray($scopes)
317317
{
318318
return \array_filter(\explode(self::SCOPE_DELIMITER_STRING, \trim($scopes)), function ($scope) {
319-
return !empty($scope);
319+
return $scope !== '';
320320
});
321321
}
322322

tests/Grant/AbstractGrantTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -431,13 +431,13 @@ public function testValidateScopes()
431431
{
432432
$scope = new ScopeEntity();
433433
$scopeRepositoryMock = $this->getMockBuilder(ScopeRepositoryInterface::class)->getMock();
434-
$scopeRepositoryMock->method('getScopeEntityByIdentifier')->willReturn($scope);
434+
$scopeRepositoryMock->expects($this->exactly(3))->method('getScopeEntityByIdentifier')->willReturn($scope);
435435

436436
/** @var AbstractGrant $grantMock */
437437
$grantMock = $this->getMockForAbstractClass(AbstractGrant::class);
438438
$grantMock->setScopeRepository($scopeRepositoryMock);
439439

440-
$this->assertEquals([$scope], $grantMock->validateScopes('basic '));
440+
$this->assertEquals([$scope, $scope, $scope], $grantMock->validateScopes('basic test 0 '));
441441
}
442442

443443
public function testValidateScopesBadScope()

0 commit comments

Comments
 (0)