1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12: 13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24: 25: 26: 27: 28: 29: 30: 31: 32: 33: 34: 35: 36: 37: 38: 39: 40:
<?php
namespace Guzzle\Tests\Http\Curl;
use Guzzle\Http\Curl\CurlVersion;
class CurlVersionTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testCachesCurlInfo()
{
$info = curl_version();
$instance = CurlVersion::getInstance();
$refObject = new \ReflectionObject($instance);
$refProperty = $refObject->getProperty('version');
$refProperty->setAccessible(true);
$refProperty->setValue($instance, array());
$this->assertEquals($info, $instance->getAll());
$this->assertEquals($info, $instance->getAll());
$this->assertEquals($info['version'], $instance->get('version'));
$this->assertFalse($instance->get('foo'));
}
public function testIsSingleton()
{
$refObject = new \ReflectionClass('Guzzle\Http\Curl\CurlVersion');
$refProperty = $refObject->getProperty('instance');
$refProperty->setAccessible(true);
$refProperty->setValue(null, null);
$this->assertInstanceOf('Guzzle\Http\Curl\CurlVersion', CurlVersion::getInstance());
}
}