當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。