public function testResponseToHttpRequesForHttpErrorThatNotThrowsException() { $httpRequest = $this->getMockBuilder('\\SMW\\HttpRequest')->disableOriginalConstructor()->getMock(); $httpRequest->expects($this->once())->method('getLastErrorCode')->will($this->returnValue(22)); $httpRequest->expects($this->once())->method('getInfo')->with($this->equalTo(CURLINFO_HTTP_CODE))->will($this->returnValue(404)); $instance = new BadHttpResponseMapper($httpRequest); $instance->mapResponseToHttpRequest('Foo', 'Bar'); }
/** * @param $endpoint string URL of endpoint that was used * @param $sparql string query that caused the problem */ protected function mapHttpRequestError($endpoint, $sparql) { if ($this->badHttpResponseMapper === null) { $this->badHttpResponseMapper = new BadHttpResponseMapper($this->httpRequest); } $this->badHttpResponseMapper->mapResponseToHttpRequest($endpoint, $sparql); }