Esempio n. 1
0
 /**
  * Renders the report.
  *
  * @param  PHPUnit_Framework_TestResult $result
  * @param  string                       $target
  * @param  string                       $charset
  * @param  boolean                      $yui
  * @param  boolean                      $highlight
  * @param  integer                      $lowUpperBound
  * @param  integer                      $highLowerBound
  */
 public static function render(PHPUnit_Framework_TestResult $result, $target, $charset = 'ISO-8859-1', $yui = TRUE, $highlight = FALSE, $lowUpperBound = 35, $highLowerBound = 70)
 {
     $target = PHPUnit_Util_Filesystem::getDirectory($target);
     self::$templatePath = sprintf('%s%sReport%sTemplate%s', dirname(__FILE__), DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR, DIRECTORY_SEPARATOR);
     $codeCoverageInformation = $result->getCodeCoverageInformation();
     $files = PHPUnit_Util_CodeCoverage::getSummary($codeCoverageInformation);
     $commonPath = PHPUnit_Util_Filesystem::reducePaths($files);
     $items = self::buildDirectoryStructure($files);
     unset($codeCoverageInformation);
     $name = $result->topTestSuite()->getName();
     unset($result);
     $root = new PHPUnit_Util_Report_Node_Directory($commonPath, NULL);
     self::addItems($root, $items, $files, $yui, $highlight);
     self::copyFiles($target);
     PHPUnit_Util_CodeCoverage::clearSummary();
     $root->render($target, $name, $charset, $lowUpperBound, $highLowerBound);
 }
Esempio n. 2
0
 /**
  * @param  string $directory
  */
 public function __construct($directory)
 {
     $this->directory = PHPUnit_Util_Filesystem::getDirectory($directory);
 }