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


PHP PHPUnit_Framework_TestCase::runTest方法代码示例

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


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

示例1: runTest

 /**
  * {@inheritdoc}
  * @see PHPUnit_Framework_TestCase::runTest()
  */
 protected function runTest()
 {
     if (isset($this->getAnnotations()['method']['functional']) && $this->isSkipFunctionalTests()) {
         $this->markTestSkipped();
     }
     return parent::runTest();
 }
开发者ID:mheydt,项目名称:scalr,代码行数:11,代码来源:TestCase.php

示例2: runTest

 /**
  * Vynucuje existenci @covers anotace při generování code coverage.
  *
  * @author Jan Tvrdík
  * @return mixed
  */
 protected function runTest()
 {
     $annotations = $this->getAnnotations();
     if (!isset($annotations['class']['covers']) && !isset($annotations['method']['covers']) && !isset($annotations['class']['coversNothing']) && !isset($annotations['method']['coversNothing'])) {
         $this->markTestIncomplete('Missing mandatory @covers or @coversNothing annotation');
     }
     return parent::runTest();
 }
开发者ID:Skokan44,项目名称:csfd-api,代码行数:14,代码来源:TestCase.php

示例3: runTest

 protected function runTest()
 {
     if (\PhpSpock\Adapter\PhpUnitAdapter::isSpecification($this)) {
         return \PhpSpock\Adapter\PhpUnitAdapter::runTest($this);
     } else {
         return parent::runTest();
     }
 }
开发者ID:aleczhang,项目名称:phpspock,代码行数:8,代码来源:WithoutIntegrationTest.php

示例4: runTest

 protected function runTest()
 {
     if ($this->isExternal() && !$this->allowExternal()) {
         $this->markTestSkipped('Test requires external reference');
         return false;
     }
     return parent::runTest();
 }
开发者ID:nhp,项目名称:Xtest,代码行数:8,代码来源:Abstract.php

示例5: runTest

 function runTest()
 {
     $startTime = microtime(true);
     parent::runTest();
     $endTime = microtime(true);
     if (0 != $this->maxRunningTime && $endTime - $startTime > $this->maxRunningTime) {
         $this->fail('expected running time: <= ' . $this->maxRunningTime . ' but was ' . ($endTime - $startTime));
     }
 }
开发者ID:xiaoguizhidao,项目名称:autotech_design,代码行数:9,代码来源:TestCase.php

示例6: runTest

 /**
  * @access protected
  */
 protected function runTest()
 {
     PHPUnit_Util_Timer::start();
     parent::runTest();
     $time = PHPUnit_Util_Timer::stop();
     if ($this->maxRunningTime != 0 && $time > $this->maxRunningTime) {
         $this->fail(sprintf('expected running time: <= %s but was: %s', $this->maxRunningTime, $time));
     }
 }
开发者ID:dalinhuang,项目名称:shopexts,代码行数:12,代码来源:PerformanceTestCase.php

示例7: runTest

 /**
  * @access public
  */
 protected function runTest()
 {
     $timer = new Benchmark_Timer();
     $timer->start();
     parent::runTest();
     $timer->stop();
     if ($this->fMaxRunningTime != 0 && $timer->timeElapsed() > $this->fMaxRunningTime) {
         PHPUnit_Framework_Assert::fail(sprintf('expected running time: <= %s but was: %s', $this->fMaxRunningTime, $timer->timeElapsed()));
     }
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:13,代码来源:PerformanceTestCase.php

示例8: runTest

 /**
  * @access public
  */
 protected function runTest()
 {
     try {
         parent::runTest();
     } catch (Exception $e) {
         if (is_a($e, $this->fExpected)) {
             return;
         } else {
             throw $e;
         }
     }
     $this->fail('Expected exception ' . $this->fExpected);
 }
开发者ID:amjadtbssm,项目名称:website,代码行数:16,代码来源:ExceptionTestCase.php

示例9: runTest

 /**
  * Wraps the default #runTest() method to provide an exception hook.
  *
  * @return mixed|null
  *
  * @throws \Exception
  */
 protected function runTest()
 {
     try {
         $result = parent::runTest();
     } catch (\Exception $ex) {
         $this->exceptionHook($ex);
         return;
     }
     // @codeCoverageIgnoreStart
     if ($this->expectException) {
         $this->fail('An exception was expected but none has been thrown.');
     }
     // @codeCoverageIgnoreEnd
     return $result;
 }
开发者ID:stefk,项目名称:jval,代码行数:22,代码来源:BaseTestCase.php

示例10: runTest

 protected function runTest()
 {
     $result = parent::runTest();
     if ($this->logStream !== NULL) {
         $this->addToAssertionCount(1);
         fseek($this->logStream, 0);
         $actualLogs = stream_get_contents($this->logStream);
         fclose($this->logStream);
         $actualLogs = array_map('rtrim', explode("\n", $actualLogs));
         $actualLogs = array_values(array_filter($actualLogs, 'strlen'));
         if ($this->expectedLogs !== NULL) {
             if (count($this->expectedLogs)) {
                 $this->assertEquals($this->expectedLogs, $actualLogs);
             } else {
                 if (count($actualLogs)) {
                     $this->fail("No logs expected, but we received:\n" . var_export($actualLogs, TRUE));
                 }
             }
         }
     }
     return $result;
 }
开发者ID:erebot,项目名称:testenv,代码行数:22,代码来源:TestCase.php

示例11: runTest

 /**
  * @access protected
  */
 protected function runTest()
 {
     $this->start();
     parent::runTest();
     try {
         $this->stop();
     } catch (RuntimeException $e) {
     }
 }
开发者ID:453111208,项目名称:bbc,代码行数:12,代码来源:SeleniumTestCase.php

示例12: runTest

 /**
  * @throws RuntimeException
  */
 protected function runTest()
 {
     $this->prepareSession();
     $thrownException = NULL;
     if ($this->collectCodeCoverageInformation) {
         $this->url($this->coverageScriptUrl);
         // phpunit_coverage.php won't do anything if the cookie isn't set, which is exactly what we want
         $this->session->cookie()->add('PHPUNIT_SELENIUM_TEST_ID', $this->testId)->set();
     }
     try {
         $this->setUpPage();
         $result = parent::runTest();
         if (!empty($this->verificationErrors)) {
             $this->fail(implode("\n", $this->verificationErrors));
         }
     } catch (Exception $e) {
         $thrownException = $e;
     }
     if ($this->collectCodeCoverageInformation) {
         $this->session->cookie()->remove('PHPUNIT_SELENIUM_TEST_ID');
     }
     if (NULL !== $thrownException) {
         throw $thrownException;
     }
     return $result;
 }
开发者ID:stas410,项目名称:xtravisx,代码行数:29,代码来源:Selenium2TestCase.php

示例13: runTest

    /**
     * @throws RuntimeException
     */
    protected function runTest()
    {
        if (!$this->serverRunning) {
            $this->markTestSkipped(
              sprintf(
                'Could not connect to Selenium RC on %s:%d.',
                $this->drivers[0]->getHost(),
                $this->drivers[0]->getPort()
              )
            );
        }

        $this->start();

        if (!is_file($this->getName(FALSE))) {
            parent::runTest();
        } else {
            $this->runSelenese($this->getName(FALSE));
        }

        if (!empty($this->verificationErrors)) {
            $this->fail(implode("\n", $this->verificationErrors));
        }

        try {
            $this->stop();
        }

        catch (RuntimeException $e) {
        }
    }
开发者ID:necromant2005,项目名称:phpunit-selenium,代码行数:34,代码来源:SeleniumTestCase.php

示例14: runTest

 /**
  * @return mixed
  * @throws RuntimeException
  */
 protected function runTest()
 {
     ob_start();
     $this->obActive = TRUE;
     try {
         $testResult = parent::runTest();
     } catch (Exception $e) {
         ob_end_clean();
         $this->obActive = FALSE;
         throw $e;
     }
     if ($this->outputCallback === FALSE) {
         $this->output = ob_get_contents();
     } else {
         $this->output = call_user_func_array($this->outputCallback, array(ob_get_contents()));
     }
     ob_end_clean();
     $this->obActive = FALSE;
     if ($this->expectedRegex !== NULL) {
         $this->assertRegExp($this->expectedRegex, $this->output);
         $this->expectedRegex = NULL;
     } else {
         if ($this->expectedString !== NULL) {
             $this->assertEquals($this->expectedString, $this->output);
             $this->expectedString = NULL;
         }
     }
     return $testResult;
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:33,代码来源:OutputTestCase.php

示例15: runTest

 /**
  * @throws RuntimeException
  */
 protected function runTest()
 {
     $this->start();
     if (!is_file($this->getName(FALSE))) {
         parent::runTest();
     } else {
         $this->runSelenese($this->getName(FALSE));
     }
     if (!empty($this->verificationErrors)) {
         $this->fail(implode("\n", $this->verificationErrors));
     }
     try {
         $this->stop();
     } catch (RuntimeException $e) {
     }
 }
开发者ID:ninodafonte,项目名称:SIFO,代码行数:19,代码来源:SeleniumTestCase.php


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