/** * @expectedException \SlevomatZboziApi\Response\ResponseErrorException * @expectedExceptionMessage Slevomat API invalid response: invalid JSON data. */ public function testResponseErrorExceptionIsThrownForResponseWithInvalidJsonData() { $this->loggerMock->expects(self::once())->method('log'); $this->httpClientMock->expects(self::once())->method('send')->willReturn(new \GuzzleHttp\Psr7\Response(200, [], '{"someData":xxx}')); $requestMaker = $this->createRequestMaker(); $requestMaker->sendPostRequest('someUrl'); }