public function afterStep(\Codeception\Event\Step $e) { if (!$this->module) { return; } if ($error = $this->module->grabCookie('CODECEPTION_CODECOVERAGE_ERROR')) { throw new RemoteException($error); } }
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']); } }
/** * @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; }
/** * @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; }