doRun() protected method

protected doRun ( )
Beispiel #1
0
 protected function doRun()
 {
     if (sizeof($this->getReports()) === 0) {
         $this->addDefaultReport();
     }
     switch ($this->reportFormat) {
         case 'xml':
         case 'clover':
             $writer = new atoum\writers\file($this->reportOutputPathIsSet()->reportOutputPath);
             $report = new atoum\reports\asynchronous\clover();
             $this->addReport($report->addWriter($writer));
             break;
         case 'html':
             $field = new atoum\report\fields\runner\coverage\html('Code coverage', $this->reportOutputPathIsSet()->reportOutputPath);
             $field->setRootUrl('file://' . realpath(rtrim($this->reportOutputPathIsSet()->reportOutputPath, DIRECTORY_SEPARATOR)) . '/index.html');
             current($this->getReports())->addField($field);
             break;
         case 'treemap':
             $field = new atoum\report\fields\runner\coverage\treemap('Code coverage treemap', $this->reportOutputPathIsSet()->reportOutputPath);
             $field->setTreemapUrl('file://' . realpath(rtrim($this->reportOutputPathIsSet()->reportOutputPath, DIRECTORY_SEPARATOR)) . '/index.html');
             current($this->getReports())->addField($field);
             break;
         default:
             throw new exceptions\logic\invalidArgument('Invalid format for coverage report');
     }
     return parent::doRun();
 }