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


PHP PHPUnit_Framework_TestResult::skipped方法代码示例

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


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

示例1: fromPHPUnitTestResult

 /**
  * Creates a Streamwide_PHPUnit_Runner_TestCaseResult from a PHPUnit_Framework_TestResult.
  *
  * @param Streamwide_PHPUnit_Runner_TestCase    $testCase   test case
  * @param PHPUnit_Framework_TestResult $testResult test result
  * @return Streamwide_PHPUnit_Runner_TestCaseResult test case result
  */
 public static function fromPHPUnitTestResult(Streamwide_PHPUnit_Runner_TestCase $testCase, PHPUnit_Framework_TestResult $testResult)
 {
     $passed = $testResult->passed();
     $skipped = $testResult->skipped();
     $errors = $testResult->errors();
     $failures = $testResult->failures();
     $notImplemented = $testResult->notImplemented();
     $time = $testResult->time();
     $statusMessage = null;
     $codeCoverage = null;
     if (!empty($passed)) {
         $status = Streamwide_PHPUnit_Runner_TestCaseResult::PASSED;
         $codeCoverage = $testResult->getCodeCoverageInformation();
     } else {
         if (!empty($skipped)) {
             $status = Streamwide_PHPUnit_Runner_TestCaseResult::SKIPPED;
             $statusMessage = $skipped[0]->toStringVerbose(true);
         } else {
             if (!empty($notImplemented)) {
                 $status = Streamwide_PHPUnit_Runner_TestCaseResult::NOT_IMPLEMENTED;
                 $statusMessage = $notImplemented[0]->toStringVerbose(true);
             } else {
                 if (!empty($errors)) {
                     $status = Streamwide_PHPUnit_Runner_TestCaseResult::ERROR;
                     $statusMessage = $errors[0]->toStringVerbose(true) . PHPUnit_Util_Filter::getFilteredStacktrace($errors[0]->thrownException());
                 } else {
                     if (!empty($failures)) {
                         $status = Streamwide_PHPUnit_Runner_TestCaseResult::FAILED;
                         $statusMessage = $failures[0]->toStringVerbose(true) . PHPUnit_Util_Filter::getFilteredStacktrace($failures[0]->thrownException());
                     }
                 }
             }
         }
     }
     $testCaseResult = new Streamwide_PHPUnit_Runner_TestCaseResult($testCase, $status, $statusMessage, null, $time, $codeCoverage);
     return $testCaseResult;
 }
开发者ID:cwcw,项目名称:cms,代码行数:44,代码来源:Factory.php

示例2: lookupResult

 /**
  * @param  PHPUnit_Framework_Test       $test
  * @param  PHPUnit_Framework_TestResult $result
  * @return mixed
  */
 public static function lookupResult(PHPUnit_Framework_Test $test, PHPUnit_Framework_TestResult $result)
 {
     $testName = self::describe($test);
     foreach ($result->errors() as $error) {
         if ($testName == self::describe($error->failedTest())) {
             return $error;
         }
     }
     foreach ($result->failures() as $failure) {
         if ($testName == self::describe($failure->failedTest())) {
             return $failure;
         }
     }
     foreach ($result->notImplemented() as $notImplemented) {
         if ($testName == self::describe($notImplemented->failedTest())) {
             return $notImplemented;
         }
     }
     foreach ($result->skipped() as $skipped) {
         if ($testName == self::describe($skipped->failedTest())) {
             return $skipped;
         }
     }
     return PHPUnit_Runner_BaseTestRunner::STATUS_PASSED;
 }
开发者ID:kytvi2p,项目名称:ZettaFramework,代码行数:30,代码来源:Test.php

示例3: printSkipped

 /**
  * @param  PHPUnit_Framework_TestResult  $result
  * @since  Method available since Release 3.0.0
  */
 protected function printSkipped(PHPUnit_Framework_TestResult $result)
 {
     $this->printDefects($result->skipped(), $result->skippedCount(), 'skipped test');
 }
开发者ID:qcodo,项目名称:qcodo,代码行数:8,代码来源:ResultPrinter.php

示例4: parseTestSuite

 /**
  * Parse the test suite result
  *
  * @param \PHPUnit_Framework_TestResult $result
  * @return array<string,double|integer|array>
  */
 private function parseTestSuite($result)
 {
     $passed = 0;
     $error = 0;
     $failed = 0;
     $notImplemented = 0;
     $skipped = 0;
     $tests = [];
     foreach ($result->passed() as $key => $value) {
         $tests[] = $this->parseTest('passed', $key);
         $passed++;
     }
     foreach ($result->failures() as $obj) {
         $tests[] = $this->parseTest('failed', $obj);
         $failed++;
     }
     foreach ($result->skipped() as $obj) {
         $tests[] = $this->parseTest('skipped', $obj);
         $skipped++;
     }
     foreach ($result->notImplemented() as $obj) {
         $tests[] = $this->parseTest('notImplemented', $obj);
         $notImplemented++;
     }
     foreach ($result->errors() as $obj) {
         $tests[] = $this->parseTest('error', $obj);
         $error++;
     }
     usort($tests, function ($a, $b) {
         return strnatcmp($a['class'], $b['class']);
     });
     return ['time' => $result->time(), 'total' => count($tests), 'passed' => $passed, 'error' => $error, 'failed' => $failed, 'notImplemented' => $notImplemented, 'skipped' => $skipped, 'tests' => $tests];
 }
开发者ID:visualphpunit,项目名称:visualphpunit,代码行数:39,代码来源:Parser.php


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