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