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


PHP SimpleTestCase类代码示例

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


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

示例1: countTestsInTestCase

 /**
  * @param SimpleTestCase $testCase
  * @return integer
  * @since Method available since Release 2.11.1
  */
 public function countTestsInTestCase(SimpleTestCase $testCase)
 {
     $tests = $testCase->getTests();
     $testCount = 0;
     if ($this->config->testsOnlySpecified()) {
         if ($this->config->testsOnlySpecifiedMethods) {
             foreach ($tests as $method) {
                 if ($this->config->inMethodsToBeTested(get_class($testCase), $method)) {
                     ++$testCount;
                 }
             }
         } elseif ($this->config->testsOnlySpecifiedClasses) {
             if ($this->config->inClassesToBeTested(get_class($testCase))) {
                 $testCount = count($tests);
             }
         }
     } else {
         $testCount = count($tests);
     }
     return $testCount;
 }
开发者ID:kumatch,项目名称:stagehand-testrunner,代码行数:26,代码来源:TestSuite.php

示例2: atTestEnd

 /**
  *    Receives event from unit test that the current
  *    test method has finished. Totals up the call
  *    counts and triggers a test assertion if a test
  *    is present for expected call counts.
  *    @param string $test_method      Current method name.
  *    @param SimpleTestCase $test     Test to send message to.
  *    @access public
  */
 function atTestEnd($test_method, &$test)
 {
     foreach ($this->_expected_counts as $method => $expectation) {
         $test->assert($expectation, $this->getCallCount($method));
     }
     foreach ($this->_max_counts as $method => $expectation) {
         if ($expectation->test($this->getCallCount($method))) {
             $test->assert($expectation, $this->getCallCount($method));
         }
     }
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:20,代码来源:mock_objects.php

示例3: isExpected

 /**
  *    Compares the expected exception with any
  *    in the queue. Issues a pass or fail and
  *    returns the state of the test.
  *    @param SimpleTestCase $test    Test case to send messages to.
  *    @param Exception $exception    Exception to compare.
  *    @return boolean                False on no match.
  */
 function isExpected($test, $exception)
 {
     if ($this->expected) {
         return $test->assert($this->expected, $exception, $this->message);
     }
     return false;
 }
开发者ID:clickdimension,项目名称:tinybutstrong,代码行数:15,代码来源:exceptions.php

示例4: runTestInvokesAfterClass

 public function runTestInvokesAfterClass()
 {
     SimpleTestCase::$dispose = 0;
     $this->suite->runTest(new SimpleTestCase('succeeds'));
     $this->assertEquals(1, SimpleTestCase::$dispose);
 }
开发者ID:melogamepay,项目名称:xp-framework,代码行数:6,代码来源:SuiteTest.class.php

示例5: invoke

 /**
  *    Invokes a single test method on the test case.
  *    This call back allows the reporter to decide if
  *    it actually wants to run the test.
  *    @param SimpleTestCase $test_case    Test case to run test on.
  *    @param string $method               Name of test method.
  *    @access public
  */
 function invoke(&$test_case, $method)
 {
     if (!$this->_is_dry_run) {
         $test_case->invoke($method);
     }
 }
开发者ID:BackupTheBerlios,项目名称:limb-svn,代码行数:14,代码来源:runner.php

示例6: runCase

 /**
  * Run a test case (usually a group/suite) with the inferred reporter.
  *
  * @param SimpleTestCase $test_case
  * @return void    This method does not return a value.
  *                 Use hasFailures() to query status after running this.
  * @todo Stop creating an individual reporter for each run, in case a client
  * calls this method multiple times.
  */
 function runCase($test_case)
 {
     $reporter = $this->createReporter();
     $test_case->run($reporter);
     $all_tests_passed = $reporter->getStatus();
     if (!$all_tests_passed) {
         $this->_failed_runs++;
     }
 }
开发者ID:ballistiq,项目名称:revive-adserver,代码行数:18,代码来源:TestRunner.php

示例7: isExpected

 /**
  *    Compares the expected exception with any
  *    in the queue. Issues a pass or fail and
  *    returns the state of the test.
  *    @param SimpleTestCase $test    Test case to send messages to.
  *    @param Exception $exception    Exception to compare.
  *    @return boolean                False on no match.
  */
 function isExpected($test, $exception)
 {
     if ($this->expected) {
         return $test->assert($this->expected, $exception, $this->message);
     }
     foreach ($this->ignored as $ignored) {
         if ($ignored->test($exception)) {
             return true;
         }
     }
     return false;
 }
开发者ID:continuousphptest,项目名称:workflow.test,代码行数:20,代码来源:exceptions.php

示例8: getTestsInTestCase

 /**
  * @param SimpleTestCase $testCase
  * @return integer
  * @since Method available since Release 2.14.0
  */
 protected function getTestsInTestCase(SimpleTestCase $testCase)
 {
     return $testCase->getTests();
 }
开发者ID:rsky,项目名称:makegood,代码行数:9,代码来源:SimpleTestTestSuite.php

示例9:

 /**
  *    Creates an empty test case. Should be subclassed
  *    with test methods for a functional test case.
  *    @param string $label     Name of test case. Will use
  *                             the class name if none specified.
  *    @access public
  */
 function __construct($label = false)
 {
     parent::__construct($label);
     $this->current_shell = $this->createShell();
     $this->last_status = false;
     $this->last_command = '';
 }
开发者ID:Boris-de,项目名称:videodb,代码行数:14,代码来源:shell_tester.php

示例10:

 /**
  *    Creates an empty test case. Should be subclassed
  *    with test methods for a functional test case.
  *    @param string $label     Name of test case. Will use
  *                             the class name if none specified.
  *    @access public
  */
 function __construct($label = false)
 {
     if (!$label) {
         $label = get_class($this);
     }
     parent::__construct($label);
 }
开发者ID:sebs,项目名称:simpletest,代码行数:14,代码来源:unit_tester.php

示例11: error

 /**
  *    Sends an error which we interpret as a fail
  *    with a different message for compatibility.
  *    @param $message        Message to display.
  *    @public
  */
 function error($message)
 {
     parent::fail("Error triggered [{$message}]");
 }
开发者ID:muhamadsyahril,项目名称:codeigniter-simpletest,代码行数:10,代码来源:phpunit_test_case.php

示例12: doLog

 public function doLog($message, $severity)
 {
     $this->test->dump(NULL, $message);
 }
开发者ID:reload,项目名称:ting-client,代码行数:4,代码来源:TingClientSimpleTestLogger.php

示例13: assertType

 /**
  *    Tests the type of a value.
  *    @param $value          Value to take type of.
  *    @param $type           Hoped for type.
  *    @param $message        Message to display.
  *    @public
  */
 function assertType($value, $type, $message = "%s")
 {
     parent::assertTrue(gettype($value) == strtolower($type), $message);
 }
开发者ID:BackupTheBerlios,项目名称:stato-svn,代码行数:11,代码来源:pear_test_case.php

示例14: tearDown

 protected function tearDown()
 {
     parent::tearDown();
 }
开发者ID:richardlawson,项目名称:gcblog,代码行数:4,代码来源:EnquiryEmailBuilderTest.php

示例15: WebTestCaseInvoker

 /**
  *    Sets the invoker to one that restarts the browser on
  *    each request.
  *    @return SimpleInvoker        Invoker for each method.
  *    @access public
  */
 function &createInvoker()
 {
     return new WebTestCaseInvoker(parent::createInvoker());
 }
开发者ID:BackupTheBerlios,项目名称:stato-svn,代码行数:10,代码来源:web_tester.php


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