Skip to content

Commit

Permalink
Fix a test exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Sephster committed Mar 21, 2024
1 parent 2cf9fbb commit e080cbf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/Grant/AbstractGrant.php
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ protected function validateClient(ServerRequestInterface $request): ClientEntity

throw OAuthServerException::invalidClient($request);
}

$client = $this->getClientEntityOrFail($clientId, $request);

// If a redirect URI is provided ensure it matches what is pre-registered
Expand Down
4 changes: 2 additions & 2 deletions tests/Grant/DeviceCodeGrantTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,7 @@ public function testRespondToRequestMissingDeviceCode(): void
$client->setIdentifier('foo');
$clientRepositoryMock = $this->getMockBuilder(ClientRepositoryInterface::class)->getMock();
$clientRepositoryMock->method('getClientEntity')->willReturn($client);
$clientRepositoryMock->method('validateClient')->willReturn(true);

$refreshTokenRepositoryMock = $this->getMockBuilder(RefreshTokenRepositoryInterface::class)->getMock();
$refreshTokenRepositoryMock->method('persistNewRefreshToken')->willReturnSelf();
Expand Down Expand Up @@ -492,9 +493,8 @@ public function testRespondToRequestMissingDeviceCode(): void

$responseType = new StubResponseType();

// TODO: We need to be more specific with this exception
// We should add an error that says the device code is missing perhaps?
$this->expectException(OAuthServerException::class);
$this->expectExceptionCode(3);

$grant->respondToAccessTokenRequest($serverRequest, $responseType, new DateInterval('PT5M'));
}
Expand Down

0 comments on commit e080cbf

Please sign in to comment.