public function __construct($options) { $this->options = $options; $this->logDir = Configuration::outputDir(); $this->settings = array_merge($this->settings, Configuration::config()['coverage']); self::$coverage = new \PHP_CodeCoverage(); // Apply filter $filter = new Filter(self::$coverage); $filter->whiteList(Configuration::config())->blackList(Configuration::config()); }
public function applyFilter(\PHPUnit_Framework_TestResult $result) { $result->setCodeCoverage(new DummyCodeCoverage()); Filter::setup($this->coverage)->whiteList($this->filters)->blackList($this->filters); $result->setCodeCoverage($this->coverage); }
/** * @param $filename * @return null|PHP_CodeCoverage */ function __c3_factory($filename) { $phpCoverage = is_readable($filename) ? unserialize(file_get_contents($filename)) : new PHP_CodeCoverage(); if (isset($_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE'])) { $suite = $_SERVER['HTTP_X_CODECEPTION_CODECOVERAGE_SUITE']; try { $settings = \Codeception\Configuration::suiteSettings($suite, \Codeception\Configuration::config()); } catch (Exception $e) { __c3_error($e->getMessage()); } } else { $settings = \Codeception\Configuration::config(); } try { \Codeception\Coverage\Filter::setup($phpCoverage)->whiteList($settings)->blackList($settings); } catch (Exception $e) { __c3_error($e->getMessage()); } return $phpCoverage; }