本文整理汇总了PHP中PHPUnit_Util_CodeCoverage::clearSummary方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPUnit_Util_CodeCoverage::clearSummary方法的具体用法?PHP PHPUnit_Util_CodeCoverage::clearSummary怎么用?PHP PHPUnit_Util_CodeCoverage::clearSummary使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPUnit_Util_CodeCoverage
的用法示例。
在下文中一共展示了PHPUnit_Util_CodeCoverage::clearSummary方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* Run a test
*/
public function run(PHPUnit_Framework_TestSuite $suite)
{
$res = new PHPUnit_Framework_TestResult();
if ($this->codecoverage) {
$res->collectCodeCoverageInformation(TRUE);
}
$res->addListener($this);
foreach ($this->formatters as $formatter) {
$res->addListener($formatter);
}
/* Set PHPUnit error handler */
if ($this->useCustomErrorHandler) {
$oldErrorHandler = set_error_handler(array('PHPUnitTestRunner', 'handleError'), E_ALL | E_STRICT);
}
$suite->run($res, false, $this->groups, $this->excludeGroups);
foreach ($this->formatters as $formatter) {
$formatter->processResult($res);
}
/* Restore Phing error handler */
if ($this->useCustomErrorHandler) {
restore_error_handler();
}
if ($this->codecoverage) {
$coverageInformation = $res->getCodeCoverageInformation();
PHPUnit_Util_CodeCoverage::clearSummary();
$summary = PHPUnit_Util_CodeCoverage::getSummary($coverageInformation);
CoverageMerger::merge($this->project, $summary);
}
if ($res->errorCount() != 0) {
$this->retCode = self::ERRORS;
} else {
if ($res->failureCount() != 0) {
$this->retCode = self::FAILURES;
} else {
if ($res->notImplementedCount() != 0) {
$this->retCode = self::INCOMPLETES;
} else {
if ($res->skippedCount() != 0) {
$this->retCode = self::SKIPPED;
}
}
}
}
}
示例2: render
/**
* Renders the report.
*
* @param PHPUnit_Framework_TestResult $result
* @param string $title
* @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, $title = '', $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);
if ($title == '') {
$topTestSuite = $result->topTestSuite();
if ($topTestSuite instanceof PHPUnit_Framework_TestSuite) {
$title = $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, $title, $charset, $lowUpperBound, $highLowerBound);
}