当前位置: 首页>>代码示例>>PHP>>正文


PHP PHPUnit_Util_CodeCoverage::clearSummary方法代码示例

本文整理汇总了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;
                 }
             }
         }
     }
 }
开发者ID:halfer,项目名称:Meshing,代码行数:47,代码来源:PHPUnitTestRunner.php

示例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);
 }
开发者ID:regnou,项目名称:AXEL-MOWER,代码行数:34,代码来源:Report.php


注:本文中的PHPUnit_Util_CodeCoverage::clearSummary方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。