/** * Test that getLastRawResponse returns null when not storing * */ public function testGetLastRawResponseWhenNotStoring() { // Now, test we get a proper response after the request $this->_client->setUri('http://example.com/foo/bar'); $this->_client->setAdapter('Zend\\Http\\Client\\Adapter\\Test'); $this->_client->setConfig(array('storeresponse' => false)); $response = $this->_client->send(); $this->assertNull($this->_client->getLastRawResponse(), 'getLastRawResponse is expected to be null when not storing'); }
/** * @param Client $target * @return $this */ public function profilerFinish(Client $target) { $current =& $this->profiles[$this->currentIndex]; $current['end'] = microtime(true); $current['elapse'] = $current['end'] - $current['start']; $current['request'] = (string) $target->getLastRawRequest(); $current['response'] = (string) $target->getLastRawResponse(); $this->currentIndex++; return $this; }