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


PHP PHPUnit_Util_Test::getSize方法代码示例

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


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

示例1: endTest

 /**
  * Informs the result that a test was completed.
  *
  * @param PHPUnit_Framework_Test $test
  * @param float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     foreach ($this->listeners as $listener) {
         $listener->endTest($test, $time);
     }
     if (!$this->lastTestFailed && $test instanceof PHPUnit_Framework_TestCase) {
         $class = get_class($test);
         $key = $class . '::' . $test->getName();
         $this->passed[$key] = ['result' => $test->getResult(), 'size' => PHPUnit_Util_Test::getSize($class, $test->getName(false))];
         $this->time += $time;
     }
 }
开发者ID:trowski,项目名称:phpunit,代码行数:18,代码来源:TestResult.php

示例2: getSize

 /**
  * Returns the size of the test.
  *
  * @return integer
  * @since  Method available since Release 3.6.0
  */
 public function getSize()
 {
     return PHPUnit_Util_Test::getSize(get_class($this), $this->getName(false));
 }
开发者ID:emsdog,项目名称:lumen-todo,代码行数:10,代码来源:TestCase.php

示例3: handleDependencies

 /**
  * @since Method available since Release 3.5.4
  */
 protected function handleDependencies()
 {
     if (!empty($this->dependencies) && !$this->inIsolation) {
         $className = get_class($this);
         $passed = $this->result->passed();
         $passedKeys = array_keys($passed);
         $numKeys = count($passedKeys);
         for ($i = 0; $i < $numKeys; $i++) {
             $pos = strpos($passedKeys[$i], ' with data set');
             if ($pos !== FALSE) {
                 $passedKeys[$i] = substr($passedKeys[$i], 0, $pos);
             }
         }
         $passedKeys = array_flip(array_unique($passedKeys));
         foreach ($this->dependencies as $dependency) {
             if (strpos($dependency, '::') === FALSE) {
                 $dependency = $className . '::' . $dependency;
             }
             if (!isset($passedKeys[$dependency])) {
                 $this->result->addError($this, new PHPUnit_Framework_SkippedTestError(sprintf('This test depends on "%s" to pass.', $dependency)), 0);
                 return FALSE;
             }
             $size = PHPUnit_Util_Test::getSize($className, $this->getName(FALSE));
             if (isset($passed[$dependency])) {
                 if ($passed[$dependency]['size'] > $size) {
                     $this->result->addError($this, new PHPUnit_Framework_SkippedTestError('This test depends on a test that is larger than itself.'), 0);
                     return FALSE;
                 }
                 $this->dependencyInput[] = $passed[$dependency]['result'];
             } else {
                 $this->dependencyInput[] = NULL;
             }
         }
     }
     return TRUE;
 }
开发者ID:proofek,项目名称:phpunit,代码行数:39,代码来源:TestCase.php


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