示例#1
0
 /**
  * Tests
  */
 public function test__construct()
 {
     $req = new Curl('file:' . $this->nullFile);
     $req->SetOption(CURLOPT_RETURNTRANSFER, TRUE);
     $req->SetConnectTimeout(20);
     $req->SetHttpTimeout(20);
     $req->SetRetries(2);
     $req->setheaders(array());
     $req->SetHeader('X-Transfer-Name', 'Glen Campbell');
     $req->Execute();
     $req->info();
     $req->errno();
     $req->error();
     $req->ReturnHeaders();
     $req->_get_header_cb(curl_init('http://example.com'), 'X-Status: Blame');
     $this->response = new Http($req, TESTDATA);
     $this->assertGreaterThan(0, count($this->response->Headers()));
     $this->assertEquals('', $req->close());
 }
示例#2
0
 public function __construct($url, $method = 'GET')
 {
     $this->url = $url;
     parent::__construct($url, $method);
 }