Example #1
0
 function testGettingVersionReturnsValidData()
 {
     $curl = new Curl();
     $version = $curl->version();
     $this->assertInternalType('array', $version);
     $this->assertArrayHasKey('version_number', $version);
 }
Example #2
0
 /**
  * @param $url
  */
 public function __construct($url = null)
 {
     $this->curl = new Curl($url);
     $this->curl->returnTransfer()->setUserAgent('libcurl-' . Curl::version()->version() . '/php-' . PHP_VERSION)->setHeaderFunction([$this, 'headerCallback'])->followLocation();
 }
Example #3
0
 public function testGetUserAgent()
 {
     $client = new Client($this->testUrl);
     $response = json_decode($client->get());
     $this->assertEquals('libcurl-' . Curl::version()->version() . '/php-' . PHP_VERSION, $response->userAgent);
 }