Пример #1
0
 function testGettingVersionReturnsValidData()
 {
     $curl = new Curl();
     $version = $curl->version();
     $this->assertInternalType('array', $version);
     $this->assertArrayHasKey('version_number', $version);
 }
Пример #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();
 }
Пример #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);
 }