public function testCanCheckAndGetForResponseType() { $clientService = $this->getMock(ClientService::class, [], [], '', false); $grant = new AuthorizationGrant($this->getMock(TokenService::class, [], [], '', false), $this->getMock(TokenService::class, [], [], '', false), $this->getMock(TokenService::class, [], [], '', false)); $accessTokenService = $this->getMock(TokenService::class, [], [], '', false); $refreshTokenService = $this->getMock(TokenService::class, [], [], '', false); $authorizationServer = new AuthorizationServer($clientService, [$grant], $accessTokenService, $refreshTokenService); $this->assertTrue($authorizationServer->hasResponseType(AuthorizationGrant::GRANT_RESPONSE_TYPE)); $this->assertFalse($authorizationServer->hasResponseType(ClientCredentialsGrant::GRANT_RESPONSE_TYPE)); $this->assertSame($grant, $authorizationServer->getResponseType(AuthorizationGrant::GRANT_RESPONSE_TYPE)); $this->setExpectedException(OAuth2Exception::class, null, 'unsupported_response_type'); $authorizationServer->getResponseType(ClientCredentialsGrant::GRANT_RESPONSE_TYPE); }