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


PHP SimpleTestCase::assertTrue方法代碼示例

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


在下文中一共展示了SimpleTestCase::assertTrue方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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::assertTrue(gettype($value) == strtolower($type), $message);
 }
開發者ID:BackupTheBerlios,項目名稱:stato-svn,代碼行數:11,代碼來源:pear_test_case.php

示例2:

 /**
  *    Triggers an assertion on the held test case.
  *    Should be overridden when using another test
  *    framework other than the SimpleTest one if the
  *    assertion method has a different name.
  *    @param boolean $assertion     True will pass.
  *    @param string $message        Message that will go with
  *                                  the test event.
  *    @param SimpleTestCase $test   Unit test case to send
  *                                  assertion to.
  *    @access protected
  */
 function _assertTrue($assertion, $message , &$test) {
     if ($test) {
         $test->assertTrue($assertion, $message);
     }
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:17,代碼來源:mock_objects.php

示例3: assert

 /**
  *    Sends pass if the test condition resolves true,
  *    a fail otherwise.
  *    @param $condition      Condition to test true.
  *    @param $message        Message to display.
  *    @public
  */
 function assert($condition, $message = false)
 {
     parent::assertTrue($condition, $message);
 }
開發者ID:TomMaher,項目名稱:umambo,代碼行數:11,代碼來源:phpunit_test_case.php

示例4: 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::assertTrue(false, "Error triggered [{$message}]");
 }
開發者ID:BackupTheBerlios,項目名稱:limb-svn,代碼行數:10,代碼來源:phpunit_test_case.php


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