/**
  * testCreateTimeChartFromUnitExecutionTime
  *
  * @return void
  */
 public function testCreateTimeChartFromUnitExecutionTime()
 {
     $this->markTestSkippedWhenEzcGraphChartNotExists();
     $input = new phpucUnitTestExecutionTimeInput();
     $input->processLog(new DOMXPath(new DOMDocument()));
     $factory = new phpucChartFactory();
     $chart = $factory->createChart($input);
     $this->assertType('phpucTimeChart', $chart);
 }
 /**
  * Generates a set of charts for each project build(if required).
  *
  * @return void
  */
 public function execute()
 {
     // Force update?
     $force = $this->debug || $this->args->hasOption('force-update');
     $inputLoader = new phpucInputLoader();
     $chartFactory = new phpucChartFactory($this->getMaxNumber());
     $logFiles = new phpucLogFileIterator($this->logDir);
     foreach ($logFiles as $logFile) {
         $xpath = new DOMXPath($logFile);
         $outputDir = "{$this->outputDir}/{$logFile->timestamp}/graph";
         foreach ($inputLoader as $input) {
             $input->processLog($xpath);
             if (count(array_filter($input->data)) === 0) {
                 continue;
             }
             if (!is_dir($outputDir)) {
                 mkdir($outputDir, 0755, true);
             }
             $fileName = "{$outputDir}/{$input->fileName}.svg";
             if (!is_dir(dirname($fileName))) {
                 mkdir(dirname($fileName));
             }
             if (!file_exists($fileName) || $force) {
                 $chart = $chartFactory->createChart($input);
                 $chart->render($input->graphDims['width'], $input->graphDims['height'], $fileName);
             }
         }
     }
 }