function testGettingVersionReturnsValidData() { $curl = new Curl(); $version = $curl->version(); $this->assertInternalType('array', $version); $this->assertArrayHasKey('version_number', $version); }
/** * @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(); }
public function testGetUserAgent() { $client = new Client($this->testUrl); $response = json_decode($client->get()); $this->assertEquals('libcurl-' . Curl::version()->version() . '/php-' . PHP_VERSION, $response->userAgent); }