コード例 #1
0
ファイル: LocalServer.php プロジェクト: Eli-TW/Codeception
 protected function c3Request($action)
 {
     $this->addC3AccessHeader(self::COVERAGE_HEADER, 'remote-access');
     $context = stream_context_create(array('http' => $this->c3Access));
     $contents = file_get_contents($this->module->_getUrl() . '/c3/report/' . $action, false, $context);
     if ($contents === false) {
         $this->getRemoteError($http_response_header);
     }
     return $contents;
 }
コード例 #2
0
ファイル: LocalServer.php プロジェクト: aleguisf/fvdev1
 protected function c3Request($action)
 {
     $this->addC3AccessHeader(self::COVERAGE_HEADER, 'remote-access');
     $context = stream_context_create(array('http' => $this->c3Access));
     $contents = file_get_contents($this->module->_getUrl() . '/c3/report/' . $action, false, $context);
     $okHeaders = array_filter($http_response_header, function ($h) {
         return preg_match('~^HTTP(.*?)\\s200~', $h);
     });
     if (empty($okHeaders)) {
         throw new RemoteException("Request was not successful. See response header: " . $http_response_header[0]);
     }
     if ($contents === false) {
         $this->getRemoteError($http_response_header);
     }
     return $contents;
 }