Esempio n. 1
0
 /**
  * @covers            PHP_CodeCoverage_Util::getDirectory
  * @expectedException RuntimeException
  */
 public function testGetDirectory3()
 {
     if (!class_exists('vfsStream')) {
         $this->markTestSkipped('vfsStream is not installed');
     }
     PHP_CodeCoverage_Util::getDirectory(vfsStream::url('/not/existing/path'));
 }
Esempio n. 2
0
 /**
  * @param PHP_CodeCoverage $coverage
  * @param string           $target
  */
 public function process(PHP_CodeCoverage $coverage, $target)
 {
     $target = PHP_CodeCoverage_Util::getDirectory($target);
     $files = $coverage->getSummary();
     $commonPath = PHP_CodeCoverage_Util::reducePaths($files);
     $items = PHP_CodeCoverage_Util::buildDirectoryStructure($files);
     $root = new PHP_CodeCoverage_Report_HTML_Node_Directory($commonPath, NULL);
     $this->addItems($root, $items, $files);
     $this->renderDashboard($root, $target . 'index.dashboard.html', $this->options['title']);
     foreach ($root as $node) {
         if ($node instanceof PHP_CodeCoverage_Report_HTML_Node_Directory) {
             $this->renderDashboard($node, $target . PHP_CodeCoverage_Util::getSafeFilename($node->getId()) . '.dashboard.html', $node->getName(TRUE));
         }
     }
     $root->render($target, $this->options['title'], $this->options['charset'], $this->options['lowUpperBound'], $this->options['highLowerBound'], $this->options['generator']);
     $this->copyFiles($target);
 }
Esempio n. 3
0
 /**
  * @param PHP_CodeCoverage $coverage
  * @param string           $target
  */
 public function process(PHP_CodeCoverage $coverage, $target)
 {
     $target = PHP_CodeCoverage_Util::getDirectory($target);
     $report = $coverage->getReport();
     unset($coverage);
     if (!isset($_SERVER['REQUEST_TIME'])) {
         $_SERVER['REQUEST_TIME'] = time();
     }
     $date = date('D M j G:i:s T Y', $_SERVER['REQUEST_TIME']);
     $dashboard = new PHP_CodeCoverage_Report_HTML_Renderer_Dashboard($this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound);
     $directory = new PHP_CodeCoverage_Report_HTML_Renderer_Directory($this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound);
     $file = new PHP_CodeCoverage_Report_HTML_Renderer_File($this->templatePath, $this->charset, $this->generator, $date, $this->lowUpperBound, $this->highLowerBound, $this->highlight, $this->yui);
     $dashboard->render($report, $target . 'index.dashboard.html', $this->title);
     $directory->render($report, $target . 'index.html', $this->title);
     foreach ($report as $node) {
         $id = $node->getId();
         if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) {
             $dashboard->render($node, $target . $id . '.dashboard.html');
             $directory->render($node, $target . $id . '.html');
         } else {
             $file->render($node, $target . $id . '.html');
         }
     }
     $this->copyFiles($target);
 }