コード例 #1
0
 public function afterStep(\Codeception\Event\Step $e)
 {
     if (!$this->module) {
         return;
     }
     if ($error = $this->module->grabCookie('CODECEPTION_CODECOVERAGE_ERROR')) {
         throw new RemoteException($error);
     }
 }
コード例 #2
0
 public function beforeStep(\Codeception\Event\Step $e)
 {
     if (!$this->module) {
         return;
     }
     $this->module->_setHeader('X-Codeception-CodeCoverage', $e->getTest()->getName());
     $this->module->_setHeader('X-Codeception-CodeCoverage-Suite', $this->suite_name);
     if ($this->settings['remote_config']) {
         $this->module->_setHeader('X-Codeception-CodeCoverage-Config', $this->settings['remote_config']);
     }
 }
コード例 #3
0
ファイル: CodeCoverage.php プロジェクト: pfz/codeception
 /**
  * @param RemoteInterface $module
  * @param $type
  *
  * @return bool|string
  */
 protected function getRemoteCoverageFile($module, $type)
 {
     $module->_setHeader('X-Codeception-CodeCoverage', 'remote-access');
     $contents = $module->_sendRequest($module->_getUrl() . '/c3/report/' . $type);
     if ($module->_getResponseCode() !== 200) {
         $this->getRemoteError($module);
     }
     return $contents;
 }
コード例 #4
0
 /**
  * @param RemoteInterface $module
  * @param $type
  *
  * @return bool|string
  */
 protected function getRemoteCoverageFile($module, $type)
 {
     $this->addHeader('X-Codeception-CodeCoverage', 'remote-access');
     $context = stream_context_create(array('http' => $this->http));
     $contents = file_get_contents($module->_getUrl() . '/c3/report/' . $type, false, $context);
     if ($contents === false) {
         $this->getRemoteError($http_response_header);
     }
     return $contents;
 }