public function testThrowExceptionIfNoResponseType() { $request = $this->getMock(ServerRequestInterface::class); $request->expects($this->once())->method('getQueryParams')->willReturn([]); $clientService = $this->getMock(ClientService::class, [], [], '', false); $accessTokenService = $this->getMock(TokenService::class, [], [], '', false); $refreshTokenService = $this->getMock(TokenService::class, [], [], '', false); $authorizationServer = new AuthorizationServer($clientService, [], $accessTokenService, $refreshTokenService); $response = $authorizationServer->handleAuthorizationRequest($request); $body = json_decode($response->getBody(), true); $this->assertEquals(400, $response->getStatusCode()); $this->assertArrayHasKey('error', $body); $this->assertArrayHasKey('error_description', $body); }