コード例 #1
0
 public function setUp()
 {
     $this->wrapper = $this->getNewWrapper();
     $this->wrapper->getConfiguration()->setUrlToLint(self::URL_TO_LINT);
     $this->setHttpFixtures($this->buildHttpFixtureSet(array('CURL/' . $this->getStatusCode() . ' message')));
     $this->wrapper->getLocalProxy()->getConfiguration()->setHttpClient($this->getHttpClient());
     $this->wrapper->enableDeferToParentIfNoRawOutput();
     try {
         $this->wrapper->validate();
         $this->fail('CURL ' . $this->getStatusCode() . ' exception not thrown');
     } catch (ConnectException $connectException) {
         $this->assertEquals('cURL error ' . $this->getStatusCode() . ': message', $connectException->getMessage());
     }
 }
コード例 #2
0
 public function setUp()
 {
     $this->wrapper = $this->getNewWrapper();
     $this->wrapper->getConfiguration()->setUrlToLint(self::URL_TO_LINT);
     $this->setHttpFixtures($this->buildHttpFixtureSet(array('HTTP/1.0 ' . $this->getStatusCode())));
     $this->wrapper->getLocalProxy()->getConfiguration()->setHttpClient($this->getHttpClient());
     $this->wrapper->enableDeferToParentIfNoRawOutput();
     try {
         $this->wrapper->validate();
         $this->fail('HTTP ' . $this->getStatusCode() . ' exception not thrown');
     } catch (\webignition\WebResource\Exception\Exception $webResourceException) {
         $this->assertEquals($this->getStatusCode(), $webResourceException->getResponse()->getStatusCode());
     }
 }
コード例 #3
0
 public function setUp()
 {
     $this->wrapper = $this->getNewWrapper();
     $this->wrapper->getConfiguration()->setUrlToLint(self::URL_TO_LINT);
     $this->wrapper->enableDeferToParentIfNoRawOutput();
 }