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:
<?php
namespace Guzzle\Tests\Http\Exception;
use Guzzle\Http\Exception\CurlException;
use Guzzle\Http\Curl\CurlHandle;
class CurlExceptionTest extends \Guzzle\Tests\GuzzleTestCase
{
public function testStoresCurlError()
{
$e = new CurlException();
$this->assertNull($e->getError());
$this->assertNull($e->getErrorNo());
$this->assertSame($e, $e->setError('test', 12));
$this->assertEquals('test', $e->getError());
$this->assertEquals(12, $e->getErrorNo());
$handle = new CurlHandle(curl_init(), array());
$e->setCurlHandle($handle);
$this->assertSame($handle, $e->getCurlHandle());
$handle->close();
}
}