예제 #1
0
 /**
  * Renders the report.
  *
  * @param $codeCoverageLineInformation      code coverage (line)	
  * @param $codeCoverageBranchInformation    code coverage (branch)	
  * @param $title string       	
  * @param $target string       	
  * @param $charset string       	
  * @param $yui boolean       	
  * @param $highlight boolean       	
  * @param $lowUpperBound integer       	
  * @param $highLowerBound integer       	
  */
 public static function render($codeCoverageLineInformation, $codeCoverageBranchInformation = array(), $target = 'CoverageReport', $title = 'PHP Coverage Report', $charset = 'ISO-8859-1', $yui = TRUE, $highlight = FALSE, $lowUpperBound = 35, $highLowerBound = 70)
 {
     ini_set('memory_limit', '2048M');
     $target = PHPCoverage_Util_Filesystem::getDirectory($target);
     self::$templatePath = sprintf('%s%sReport%sTemplate%s', dirname(__FILE__), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
     $files = self::formatCoverageData($codeCoverageLineInformation);
     PHPCoverage_Util_CodeCoverage::setBranchInformation($codeCoverageBranchInformation);
     $commonPath = PHPCoverage_Util_Filesystem::reducePaths($files);
     $items = self::buildDirectoryStructure($files);
     unset($codeCoverageLineInformation);
     $root = new PHPCoverage_Util_Report_Node_Directory($commonPath, NULL);
     unset($commonPath);
     self::addItems($root, $items, $files, $yui, $highlight);
     self::copyFiles($target);
     PHPCoverage_Util_CodeCoverage::clearSummary();
     $root->render($target, $title, $charset, $lowUpperBound, $highLowerBound);
 }
 public function generateReport()
 {
     $this->_coverageData = array();
     $this->getRecord();
     echo "INFO____: Generating report, this may take a few minutes, please wait patiently...\n";
     //echo "INFO____: Memory used: " . (int)(xdebug_memory_usage()/(1024*1024)) . "M.\n";
     if (!empty($this->_backupLog)) {
         $this->backupRecord();
     }
     $data = PHPCoverage_Util_CodeCoverage::formatCodeCoverage($this->_coverageData);
     $codeCoverageLineInformation = $data['codeCoverage_line'];
     $codeCoverageBranchInformation = $data['codeCoverage_branch'];
     unset($data);
     PHPCoverage_Util_Report::render($codeCoverageLineInformation, $codeCoverageBranchInformation, $this->_coverageReportDirectory, $this->_coverageReportTitle);
 }