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


PHP PHPUnit_Framework_Test::getNumAssertions方法代码示例

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


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

示例1: endTest

 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     // copied from parent:endTest()
     if ($test instanceof PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     } else {
         if ($test instanceof PHPUnit_Extensions_PhptTestCase) {
             $this->numAssertions++;
         }
     }
     $this->lastTestFailed = false;
     // custom printing code
     if (get_class($test) == 'PHPUnit_Framework_TestSuite') {
         // this occurs when the test suite setup has thrown an error
         $this->out(" SETUP FAIL", 'fg-red', true);
     } elseif ($test->hasFailed()) {
         $this->out(" FAIL", 'fg-red', true);
     } else {
         $numAssertions = $test instanceof PHPUnit_Framework_TestCase ? $test->getNumAssertions() : 1;
         if ($numAssertions > 0) {
             $this->out(' OK (' . $numAssertions . ' assertions)', 'fg-green', true);
         } else {
             $this->out(' SKIPPED (0 assertions)', 'fg-yellow', true);
         }
     }
 }
开发者ID:mymizan,项目名称:phreeze,代码行数:26,代码来源:VerboseTestResultPrinter.php

示例2: endTest

 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     if ($test instanceof \PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     }
     $this->lastTestFailed = false;
 }
开发者ID:itillawarra,项目名称:cmfive,代码行数:7,代码来源:UI.php

示例3: endTest

 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     if ($this->attachCurrentTestCase and $test instanceof Test) {
         $numAssertions = $test->getNumAssertions();
         $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions;
         $this->currentTestCase->setAttribute('assertions', $numAssertions);
     }
     parent::endTest($test, $time);
 }
开发者ID:foxman209,项目名称:Codeception,代码行数:9,代码来源:JUnit.php

示例4: endTest

 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if ($test->hasFailed()) {
         printf(" FAIL\n");
     } else {
         printf(" OK\n");
     }
     if ($test instanceof PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     } else {
         if ($test instanceof PHPUnit_Extensions_PhptTestCase) {
             $this->numAssertions++;
         }
     }
 }
开发者ID:joaoricardorm,项目名称:phreeze,代码行数:15,代码来源:VerboseTestResultPrinter.php

示例5: endTest

 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     //		if ($test instanceof \PHPUnit_Framework_TestCase) {
     $this->numAssertions += $test->getNumAssertions();
     //        }
 }
开发者ID:pago,项目名称:pantr,代码行数:6,代码来源:PHPUnit.php

示例6: endTest

 /**
  * A test ended.
  *
  * @param  PHPUnit_Framework_Test $test
  * @param  float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if (!$test instanceof PHPUnit_Framework_Warning) {
         if ($this->attachCurrentTestCase) {
             if ($test instanceof PHPUnit_Framework_TestCase) {
                 $numAssertions = $test->getNumAssertions();
                 $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions;
                 $this->currentTestCase->setAttribute('assertions', $numAssertions);
             }
             $this->currentTestCase->setAttribute('time', sprintf('%F', $time));
             $this->testSuites[$this->testSuiteLevel]->appendChild($this->currentTestCase);
             $this->testSuiteTests[$this->testSuiteLevel]++;
             $this->testSuiteTimes[$this->testSuiteLevel] += $time;
         }
     }
     $this->attachCurrentTestCase = TRUE;
     $this->currentTestCase = NULL;
 }
开发者ID:raul1234587,项目名称:phpunit,代码行数:24,代码来源:JUnit.php

示例7: endTest

 /**
  * A test ended.
  *
  * @param  PHPUnit_Framework_Test $test
  * @param  float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if (!$this->lastTestFailed) {
         $this->writeProgress($this->green('.'));
     }
     if ($test instanceof PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     } else {
         if ($test instanceof PHPUnit_Extensions_PhptTestCase) {
             $this->numAssertions++;
         }
     }
     $this->lastTestFailed = FALSE;
     if ($this->verbose && $test instanceof PHPUnit_Framework_TestCase) {
         $this->write($test->getActualOutput());
     }
 }
开发者ID:joskfg,项目名称:guard-phpunit2,代码行数:23,代码来源:ResultPrinter.php

示例8: endTest

 /**
  * A test ended.
  *
  * @param PHPUnit_Framework_Test $test
  * @param float                  $time
  *
  * @return void
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     $this->assertionCount += $test->getNumAssertions();
 }
开发者ID:remicollet,项目名称:php-compat-info,代码行数:12,代码来源:GrowlTestListener.php

示例9: endTest

 /**
  * A test ended.
  *
  * @param  PHPUnit_Framework_Test $test
  * @param  float $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     $this->numAssertions += $test->getNumAssertions();
     $this->paintPass($test, $time);
 }
开发者ID:Juan09130424,项目名称:CakePHP---Bootstrap-template,代码行数:11,代码来源:CakeBaseReporter.php

示例10: endTest

 /**
  * A test ended.
  *
  * @param \PHPUnit_Framework_Test $test
  * @param float                  $time
  */
 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     if (!$this->lastTestFailed) {
         $this->writeTestStatus(self::STATUS_OK);
     }
     if ($test instanceof \PHPUnit_Framework_TestCase) {
         /** @var \PHPUnit_Framework_TestCase $test */
         $this->numAssertions += $test->getNumAssertions();
     }
     $this->lastEvent = self::EVENT_TEST_END;
     $this->lastTestFailed = false;
 }
开发者ID:visor,项目名称:nano,代码行数:18,代码来源:ResultPrinter.php

示例11: endTest

 /**
  * @param \PHPUnit_Framework_Test $test
  * @param float                   $time
  */
 public function endTest(\PHPUnit_Framework_Test $test, $time)
 {
     if ($test instanceof \PHPUnit_Framework_TestCase) {
         $this->junitXMLWriter->endTestCase($time, $test->getNumAssertions());
     } else {
         $this->junitXMLWriter->endTestCase($time);
     }
     $this->testStarted = false;
 }
开发者ID:piece,项目名称:stagehand-testrunner,代码行数:13,代码来源:JUnitXMLPrinter.php

示例12: endTest

 /**
  * @param PHPUnit_Framework_Test $test
  * @param float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if (!$test instanceof PHPUnit_Framework_TestCase) {
         $this->xmlWriter->endTestCase($time);
         return;
     }
     $this->xmlWriter->endTestCase($time, $test->getNumAssertions());
 }
开发者ID:kumatch,项目名称:stagehand-testrunner,代码行数:12,代码来源:JUnitXMLPrinter.php

示例13: endTest

 /**
  * A test ended.
  *
  * @param PHPUnit_Framework_Test $test
  * @param float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if ($this->attachCurrentTestCase) {
         if ($test instanceof PHPUnit_Framework_TestCase) {
             $numAssertions = $test->getNumAssertions();
             $this->testSuiteAssertions[$this->testSuiteLevel] += $numAssertions;
             $this->currentTestCase->setAttribute('assertions', $numAssertions);
         }
         $this->currentTestCase->setAttribute('time', sprintf('%F', $time));
         $this->testSuites[$this->testSuiteLevel]->appendChild($this->currentTestCase);
         $this->testSuiteTests[$this->testSuiteLevel]++;
         $this->testSuiteTimes[$this->testSuiteLevel] += $time;
         if (method_exists($test, 'hasOutput') && $test->hasOutput()) {
             $systemOut = $this->document->createElement('system-out');
             $systemOut->appendChild($this->document->createTextNode($test->getActualOutput()));
             $this->currentTestCase->appendChild($systemOut);
         }
     }
     $this->attachCurrentTestCase = true;
     $this->currentTestCase = null;
 }
开发者ID:ronaldbao,项目名称:phpunit,代码行数:27,代码来源:JUnit.php

示例14: endTest

 /**
  * A test ended.
  *
  * @param PHPUnit_Framework_Test $test
  * @param float                  $time
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if (!$this->lastTestFailed) {
         $this->writeProgress('.');
     }
     if ($test instanceof PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     } elseif ($test instanceof PHPUnit_Extensions_PhptTestCase) {
         $this->numAssertions++;
     }
     $this->lastTestFailed = false;
     if ($test instanceof PHPUnit_Framework_TestCase) {
         if (!$test->hasExpectationOnOutput()) {
             $this->write($test->getActualOutput());
         }
     }
 }
开发者ID:stephenmoore56,项目名称:mooredatabase-laravel,代码行数:23,代码来源:ResultPrinter.php

示例15: endTest

 /**
  * A test ended.
  *
  * @param  PHPUnit_Framework_Test $test
  * @param  float                  $time
  * @access public
  */
 public function endTest(PHPUnit_Framework_Test $test, $time)
 {
     if (!$this->lastTestFailed) {
         $this->writeProgress("[1;32m✓[0m");
     }
     if ($test instanceof PHPUnit_Framework_TestCase) {
         $this->numAssertions += $test->getNumAssertions();
     }
     $this->lastEvent = self::EVENT_TEST_END;
     $this->lastTestFailed = false;
     $this->column++;
     $this->testsRun++;
     $this->suiteTestsRun[count($this->suiteTestsRun) - 1]++;
     // Wrap tests, if they exceed the column width
     if ($this->column >= 72) {
         echo " ↩\n", str_repeat(' ', ($this->column = end($this->indentation)) - 2), '↳ ';
     }
 }
开发者ID:kore,项目名称:arbit-result-printer,代码行数:25,代码来源:printer.php


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