Skip to content

Commit 2f39f74

Browse files
committed
Make tests pass
1 parent f19d3e9 commit 2f39f74

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Filters/OAuthFilter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ public function validateScopes()
104104
{
105105
foreach($this->scopes as $scope) {
106106
if(!$this->authorizer->hasScope($scope)) {
107-
throw new InvalidScopeException(implode(',', $this->scopes));
107+
throw new InvalidScopeException($scope);
108108
}
109109
}
110110
}

tests/unit/LucaDegasperi/OAuth2Server/Filters/OAuthFilterSpec.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@ function it_filters_against_invalid_access_tokens(Authorizer $authorizer)
2828
function it_filters_against_invalid_scopes(Authorizer $authorizer)
2929
{
3030
$authorizer->validateAccessToken(false)->willReturn('foo')->shouldBeCalled();
31-
$authorizer->hasScope(['baz'])->willReturn(false)->shouldBeCalled();
31+
$authorizer->hasScope('baz')->willReturn(false)->shouldBeCalled();
3232

3333
$this->shouldThrow('\League\OAuth2\Server\Exception\InvalidScopeException')
3434
->duringFilter('foo', 'bar', 'baz');
3535
}
3636

37-
function it_passes_with_valud_scopes(Authorizer $authorizer)
37+
function it_passes_with_valid_scopes(Authorizer $authorizer)
3838
{
3939
$authorizer->validateAccessToken(false)->willReturn('foo')->shouldBeCalled();
40-
$authorizer->hasScope(['baz'])->willReturn(true)->shouldBeCalled();
40+
$authorizer->hasScope('baz')->willReturn(true)->shouldBeCalled();
4141

4242
$this->filter('foo', 'bar', 'baz')->shouldReturn(null);
4343
}

0 commit comments

Comments
 (0)