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