Example #1
0
 /**
  * @param CodeCoverage $coverage
  * @param string       $target
  *
  * @throws RuntimeException
  */
 public function process(CodeCoverage $coverage, $target)
 {
     if (substr($target, -1, 1) != DIRECTORY_SEPARATOR) {
         $target .= DIRECTORY_SEPARATOR;
     }
     $this->target = $target;
     $this->initTargetDirectory($target);
     $report = $coverage->getReport();
     $this->project = new Project($coverage->getReport()->getName());
     $this->processTests($coverage->getTests());
     $this->processDirectory($report, $this->project);
     $index = $this->project->asDom();
     $index->formatOutput = true;
     $index->preserveWhiteSpace = false;
     $index->save($target . '/index.xml');
 }