Exemple #1
0
 /**
  * @test
  */
 public function curlReturnsCorrectErrorValuesForNonExistingUrl()
 {
     try {
         $this->_curl->getPage('non-existing.url');
         $this->fail('Expected \\Library\\CurlBundle\\Classes\\Curl\\Exception, nothing has been thrown.');
     } catch (\Library\CurlBundle\Classes\Curl\Exception $ex) {
         $this->assertEquals(6, $this->_curl->getErrno());
     }
 }
Exemple #2
0
 public function __construct($timeout = 5, $iterations = 3)
 {
     parent::__construct($timeout, $iterations);
     curl_setopt($this->_curl, CURLOPT_USERAGENT, 'Googlebot/2.1 (+http://www.google.com/bot.html)');
     curl_setopt($this->_curl, CURLOPT_REFERER, 'http://www.google.com');
 }