/** * Extracts all of the response information. * @param SimpleHttpResponse $response Response being parsed. * @access private */ protected function extractResponse($response) { $this->transport_error = $response->getError(); $this->raw = $response->getContent(); $this->sent = $response->getSent(); $this->headers = $response->getHeaders(); $this->method = $response->getMethod(); $this->url = $response->getUrl(); $this->request_data = $response->getRequestData(); }
/** * Extracts all of the response information. * @param SimpleHttpResponse $response Response being parsed. * @access private */ function _extractResponse($response) { $this->_transport_error = $response->getError(); $this->_raw = $response->getContent(); $this->_sent = $response->getSent(); $this->_headers = $response->getHeaders(); $this->_method = $response->getMethod(); $this->_url = $response->getUrl(); $this->_request_data = $response->getRequestData(); }
public function testBadRequest() { $socket = new MockSimpleSocket(); $socket->setReturnValue('getSent', ''); $response = new SimpleHttpResponse($socket, new SimpleUrl('here'), new SimpleGetEncoding()); $this->assertTrue($response->isError()); $this->assertPattern('/Nothing fetched/', $response->getError()); $this->assertIdentical($response->getContent(), false); $this->assertIdentical($response->getSent(), ''); }