Ejemplo n.º 1
0
 /**
  * If we are processing uncovered files from whitelist,
  * we can initialize the data before we start to speed up the tests
  */
 protected function initializeData()
 {
     $this->isInitialized = true;
     if ($this->processUncoveredFilesFromWhitelist) {
         $this->shouldCheckForDeadAndUnused = false;
         $this->driver->start(true);
         foreach ($this->filter->getWhitelist() as $file) {
             if ($this->filter->isFile($file)) {
                 include_once $file;
             }
         }
         $data = [];
         $coverage = $this->driver->stop();
         foreach ($coverage as $file => $fileCoverage) {
             if ($this->filter->isFiltered($file)) {
                 continue;
             }
             foreach (array_keys($fileCoverage) as $key) {
                 if ($fileCoverage[$key] == Driver::LINE_EXECUTED) {
                     $fileCoverage[$key] = Driver::LINE_NOT_EXECUTED;
                 }
             }
             $data[$file] = $fileCoverage;
         }
         $this->append($data, 'UNCOVERED_FILES_FROM_WHITELIST');
     }
 }