/** * @expectedException InvalidArgumentException */ public function testUnsupportedFormat() { $content = '<html></html>'; $headers = ['content-type' => 'text/html; charset=ISO-8859-1']; $response = $this->responseFactory($content, $headers); ResponseParser::extractDataFromResponse($response); }
public function sendData($data) { $httpRequest = RequestFactory::make($this->getEndpointUrl($data), $this->getHttpRequestData($data), $this->getHttpRequestQueryParameters($data), $this->getHttpRequestHeaders($data), $this->getHttpRequestMethod($data)); $httpResponse = $this->sendHttpMessage($httpRequest, false); $processedHttpResponse = $this->processHttpResponse($httpResponse); $this->response = $this->createResponse(ResponseParser::extractDataFromResponse($processedHttpResponse), $processedHttpResponse->getStatusCode()); return $this->response; }