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


PHP PHP_CodeCoverage_Report_Node类代码示例

本文整理汇总了PHP中PHP_CodeCoverage_Report_Node的典型用法代码示例。如果您正苦于以下问题:PHP PHP_CodeCoverage_Report_Node类的具体用法?PHP PHP_CodeCoverage_Report_Node怎么用?PHP PHP_CodeCoverage_Report_Node使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了PHP_CodeCoverage_Report_Node类的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderItem

 /**
  * @param  PHP_CodeCoverage_Report_Node $item
  * @param  boolean                      $total
  * @return string
  */
 protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = false)
 {
     $data = array('numClasses' => $item->getNumClassesAndTraits(), 'numTestedClasses' => $item->getNumTestedClassesAndTraits(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'linesExecutedPercent' => $item->getLineExecutedPercent(false), 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), 'numExecutedLines' => $item->getNumExecutedLines(), 'numExecutableLines' => $item->getNumExecutableLines(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(false), 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), 'testedClassesPercent' => $item->getTestedClassesAndTraitsPercent(false), 'testedClassesPercentAsString' => $item->getTestedClassesAndTraitsPercent());
     if ($total) {
         $data['name'] = 'Total';
     } else {
         if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) {
             $data['name'] = sprintf('<a href="%s/index.html">%s</a>', $item->getName(), $item->getName());
             $data['icon'] = '<span class="glyphicon glyphicon-folder-open"></span> ';
         } else {
             $data['name'] = sprintf('<a href="%s.html">%s</a>', $item->getName(), $item->getName());
             $data['icon'] = '<span class="glyphicon glyphicon-file"></span> ';
         }
     }
     return $this->renderItemTemplate(new Text_Template($this->templatePath . 'directory_item.html', '{{', '}}'), $data);
 }
开发者ID:illuminate3,项目名称:PMPortal,代码行数:21,代码来源:Directory.php

示例2: getPathToRoot

 protected function getPathToRoot(PHP_CodeCoverage_Report_Node $node)
 {
     $id = $node->getId();
     $depth = substr_count($id, '/');
     if ($id != 'index' && $node instanceof PHP_CodeCoverage_Report_Node_Directory) {
         $depth++;
     }
     return str_repeat('../', $depth);
 }
开发者ID:MachiavelliQ,项目名称:www,代码行数:9,代码来源:Renderer.php

示例3: getBreadcrumbs

 protected function getBreadcrumbs(PHP_CodeCoverage_Report_Node $node)
 {
     $breadcrumbs = '';
     $path = $node->getPathAsArray();
     foreach ($path as $step) {
         if ($step !== $node) {
             $breadcrumbs .= sprintf('        <li><a href="%s.html">%s</a> <span class="divider">/</span></li>' . "\n", $step->getId(), $step->getName());
         } else {
             $breadcrumbs .= sprintf('        <li class="active">%s</li>' . "\n", $step->getName());
             if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) {
                 $breadcrumbs .= sprintf('        <li>(<a href="%s.dashboard.html">Dashboard</a>)</li>' . "\n", $step->getId());
             }
         }
     }
     return $breadcrumbs;
 }
开发者ID:manzapanza,项目名称:cakephp-api-utils,代码行数:16,代码来源:Renderer.php

示例4: __construct

 /**
  * Constructor.
  *
  * @param  string                       $name
  * @param  PHP_CodeCoverage_Report_Node $parent
  * @param  array                        $coverageData
  * @param  array                        $testData
  * @param  boolean                      $cacheTokens
  */
 public function __construct($name, PHP_CodeCoverage_Report_Node $parent, array $coverageData, array $testData, $cacheTokens)
 {
     if (!is_bool($cacheTokens)) {
         throw new InvalidArgumentException();
     }
     parent::__construct($name, $parent);
     $this->coverageData = $coverageData;
     $this->testData = $testData;
     $this->ignoredLines = PHP_CodeCoverage_Util::getLinesToBeIgnored($this->getPath(), $cacheTokens);
     $this->cacheTokens = $cacheTokens;
     $this->calculateStatistics();
 }
开发者ID:staabm,项目名称:redaxo,代码行数:21,代码来源:File.php

示例5: setCommonTemplateVariables

 /**
  * @param Text_Template                $template
  * @param string                       $title
  * @param PHP_CodeCoverage_Report_Node $node
  */
 protected function setCommonTemplateVariables(Text_Template $template, $title, PHP_CodeCoverage_Report_Node $node = NULL)
 {
     $link = '';
     if ($node !== NULL) {
         $path = $node->getPathAsArray();
         foreach ($path as $step) {
             $link .= sprintf('%s<a href="%s.html">%s</a>', !empty($link) ? '/' : '', $step->getId(), $step->getName());
         }
     }
     $template->setVar(array('title' => $title, 'link' => $link, 'charset' => $this->charset, 'date' => $this->date, 'version' => '1.1.2', 'php_version' => PHP_VERSION, 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound));
 }
开发者ID:DaveNascimento,项目名称:civicrm-packages,代码行数:16,代码来源:Renderer.php

示例6: getInactiveBreadcrumb

 protected function getInactiveBreadcrumb(PHP_CodeCoverage_Report_Node $node)
 {
     return sprintf('        <li><a href="%s.html">%s</a> <span class="divider">/</span></li>' . "\n", $node->getId(), $node->getName());
 }
开发者ID:altesien,项目名称:FinalProject,代码行数:4,代码来源:Renderer.php

示例7: getActiveBreadcrumb

 protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node)
 {
     return sprintf('        <li><a href="index.html">%s</a></li>' . "\n" . '        <li class="active">(Dashboard)</li>' . "\n", $node->getName());
 }
开发者ID:ezrra,项目名称:PHP,代码行数:4,代码来源:Dashboard.php

示例8: renderItem

 /**
  * @param  PHP_CodeCoverage_Report_Node $item
  * @param  boolean                      $total
  * @return string
  */
 protected function renderItem(PHP_CodeCoverage_Report_Node $item, $total = FALSE)
 {
     $data = array('numClasses' => $item->getNumClasses(), 'numTestedClasses' => $item->getNumTestedClasses(), 'numMethods' => $item->getNumMethods(), 'numTestedMethods' => $item->getNumTestedMethods(), 'linesExecutedPercent' => $item->getLineExecutedPercent(FALSE), 'linesExecutedPercentAsString' => $item->getLineExecutedPercent(), 'numExecutedLines' => $item->getNumExecutedLines(), 'numExecutableLines' => $item->getNumExecutableLines(), 'testedMethodsPercent' => $item->getTestedMethodsPercent(FALSE), 'testedMethodsPercentAsString' => $item->getTestedMethodsPercent(), 'testedClassesPercent' => $item->getTestedClassesPercent(FALSE), 'testedClassesPercentAsString' => $item->getTestedClassesPercent());
     if ($total) {
         $data['itemClass'] = 'coverDirectory';
         $data['name'] = 'Total';
     } else {
         $data['name'] = sprintf('<a href="%s.html">%s</a>', $item->getId(), $item->getName());
         if ($item instanceof PHP_CodeCoverage_Report_Node_Directory) {
             $data['icon'] = '<img alt="directory" src="directory.png"/> ';
             $data['itemClass'] = 'coverDirectory';
         } else {
             $data['icon'] = '<img alt="file" src="file.png"/> ';
             $data['itemClass'] = 'coverFile';
         }
     }
     return $this->renderItemTemplate(new Text_Template($this->templatePath . 'directory_item.html'), $data);
 }
开发者ID:qube81,项目名称:old-phpunit,代码行数:23,代码来源:Directory.php

示例9: getActiveBreadcrumb

 protected function getActiveBreadcrumb(PHP_CodeCoverage_Report_Node $node)
 {
     $buffer = sprintf('        <li class="active">%s</li>' . "\n", $node->getName());
     if ($node instanceof PHP_CodeCoverage_Report_Node_Directory) {
         $buffer .= '        <li>(<a href="dashboard.html">Dashboard</a>)</li>' . "\n";
     }
     return $buffer;
 }
开发者ID:cruni505,项目名称:prestomed,代码行数:8,代码来源:Renderer.php

示例10: __construct

 /**
  * Constructor.
  *
  * @param  string                       $name
  * @param  PHP_CodeCoverage_Report_Node $parent
  * @param  array                        $coverageData
  * @param  array                        $testData
  * @param  bool                         $cacheTokens
  *
  * @throws PHP_CodeCoverage_Exception
  */
 public function __construct($name, PHP_CodeCoverage_Report_Node $parent, array $coverageData, array $testData, $cacheTokens)
 {
     if (!is_bool($cacheTokens)) {
         throw PHP_CodeCoverage_Util_InvalidArgumentHelper::factory(1, 'boolean');
     }
     parent::__construct($name, $parent);
     $this->coverageData = $coverageData;
     $this->testData = $testData;
     $this->cacheTokens = $cacheTokens;
     $this->calculateStatistics();
 }
开发者ID:mrbadao,项目名称:api-official,代码行数:22,代码来源:File.php

示例11: setTotals

 private function setTotals(PHP_CodeCoverage_Report_Node $node, PHP_CodeCoverage_Report_XML_Totals $totals)
 {
     $loc = $node->getLinesOfCode();
     $totals->setNumLines($loc['loc'], $loc['cloc'], $loc['ncloc'], $node->getNumExecutableLines(), $node->getNumExecutedLines());
     $totals->setNumClasses($node->getNumClasses(), $node->getNumTestedClasses());
     $totals->setNumTraits($node->getNumTraits(), $node->getNumTestedTraits());
     $totals->setNumMethods($node->getNumMethods(), $node->getNumTestedMethods());
     $totals->setNumFunctions($node->getNumFunctions(), $node->getNumTestedFunctions());
 }
开发者ID:illuminate3,项目名称:PMPortal,代码行数:9,代码来源:XML.php

示例12: setCommonTemplateVariables

 /**
  * @param Text_Template                $template
  * @param PHP_CodeCoverage_Report_Node $node
  */
 protected function setCommonTemplateVariables(Text_Template $template, PHP_CodeCoverage_Report_Node $node)
 {
     $runtime = new Runtime();
     $template->setVar(array('id' => $node->getId(), 'full_path' => $node->getPath(), 'path_to_root' => $this->getPathToRoot($node), 'breadcrumbs' => $this->getBreadcrumbs($node), 'date' => $this->date, 'version' => $this->version, 'runtime_name' => $runtime->getName(), 'runtime_version' => $runtime->getVersion(), 'runtime_link' => $runtime->getVendorUrl(), 'generator' => $this->generator, 'low_upper_bound' => $this->lowUpperBound, 'high_lower_bound' => $this->highLowerBound));
 }
开发者ID:dav-m85,项目名称:busfactor,代码行数:9,代码来源:Renderer.php

示例13: getPathAsArray

 /**
  * @return array
  */
 public function getPathAsArray()
 {
     if ($this->pathArray === NULL) {
         if ($this->parent === NULL) {
             $this->pathArray = array();
         } else {
             $this->pathArray = $this->parent->getPathAsArray();
         }
         $this->pathArray[] = $this;
     }
     return $this->pathArray;
 }
开发者ID:habibmasuro,项目名称:Bitcoin-PHP-API,代码行数:15,代码来源:Node.php


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