當前位置: 首頁>>代碼示例>>PHP>>正文


PHP SimpleTestCase::assert方法代碼示例

本文整理匯總了PHP中SimpleTestCase::assert方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimpleTestCase::assert方法的具體用法?PHP SimpleTestCase::assert怎麽用?PHP SimpleTestCase::assert使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在SimpleTestCase的用法示例。


在下文中一共展示了SimpleTestCase::assert方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: 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::assert(new TrueExpectation(), gettype($value) == strtolower($type), $message);
 }
開發者ID:nsystem1,項目名稱:ZeeJong,代碼行數:11,代碼來源:pear_test_case.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);
     }
     foreach ($this->ignored as $ignored) {
         if ($ignored->test($exception)) {
             return true;
         }
     }
     return false;
 }
開發者ID:continuousphptest,項目名稱:workflow.test,代碼行數:20,代碼來源:exceptions.php

示例4: 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

示例5: assertRegexp

 /**
  *    Tests a regex match.
  *    @param $pattern        Regex to match.
  *    @param $subject        String to search in.
  *    @param $message        Message to display.
  *    @public
  */
 function assertRegexp($pattern, $subject, $message = false)
 {
     parent::assert(new PatternExpectation($pattern), $subject, $message);
 }
開發者ID:muhamadsyahril,項目名稱:codeigniter-simpletest,代碼行數:11,代碼來源:phpunit_test_case.php


注:本文中的SimpleTestCase::assert方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。