Пример #1
0
 public function beforeSuite(\Codeception\Event\Suite $e)
 {
     $settings = $e->getSettings();
     $this->applySettings($settings);
     $e->getResult()->setCodeCoverage(new \Codeception\PHPUnit\DummyCodeCoverage());
     if (!$this->enabled or $this->remote) {
         return;
     }
     \Codeception\CodeCoverageSettings::setup($this->coverage)->filterWhiteList($settings)->filterBlackList($settings);
     $e->getResult()->setCodeCoverage($this->coverage);
 }
Пример #2
0
 /**
  * @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\CodeCoverageSettings::setup($phpCoverage)->filterWhiteList($settings)->filterBlackList($settings);
     } catch (Exception $e) {
         __c3_error($e->getMessage());
     }
     return $phpCoverage;
 }