/** * Applies the options to the specified ACurl object. * @param ACurl $curl The ACurl object to apply the options to */ public function applyTo(ACurl $curl) { foreach ($this as $key => $value) { $constant = constant($this->getConstantName($key)); curl_setopt($curl->getHandle(), $constant, $value); } }
/** * Returns information about the CURL response. * @return CAttributeCollection the curl response details */ public function getInfo() { if ($this->_info === null) { $this->_info = new CAttributeCollection(curl_getinfo($this->request->getHandle()), true); } return $this->_info; }
/** * Tests performing a http head request for a non existant URL * @expectedException ACurlException */ public function testHead404() { $curl = new ACurl(); $response = $curl->head("http://uk3.php.net/manual/en/arglebargle")->info; $this->assertEquals("text/html;charset=utf-8", $response->content_type); $this->assertEquals(404, $response->http_code); }