<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # assertThat() 可以用 `PHPUnit_Framework_Constraint` 類來訂立更加復雜的斷言。隨后可以用 `assertThat()` 方法來評定這些斷言。[Example?A.42, “assertThat() 的用法”](# "Example?A.42.?assertThat() 的用法") 展示了如何用 `logicalNot()` 和 `equalTo()` 約束條件來表達與 `assertNotEquals()` 等價的斷言。 >[info] ## assertThat(mixed $value, PHPUnit_Framework_Constraint $constraint[, $message = '']) 當 `$value` 不符合約束條件 `$constraint` 時報告錯誤,錯誤訊息由 `$message` 指定。 **Example?A.42.?assertThat() 的用法** ~~~ <?php class BiscuitTest extends PHPUnit_Framework_TestCase { public function testEquals() { $theBiscuit = new Biscuit('Ginger'); $myBiscuit = new Biscuit('Ginger'); $this->assertThat( $theBiscuit, $this->logicalNot( $this->equalTo($myBiscuit) ) ); } } ?> ~~~ [Table?A.1, “約束條件”](# "Table?A.1.?約束條件")列舉了所有可用的 `PHPUnit_Framework_Constraint` 類。 **Table?A.1.?約束條件** | 約束條件 | 含義 | |-----|-----| | `PHPUnit_Framework_Constraint_Attribute attribute(PHPUnit_Framework_Constraint $constraint, $attributeName)` | 此約束將另外一個約束應用于某個類或對象的某個屬性。 | | `PHPUnit_Framework_Constraint_IsAnything anything()` | 此約束接受任意輸入值。 | | `PHPUnit_Framework_Constraint_ArrayHasKey arrayHasKey(mixed $key)` | 此約束斷言所評定的數組擁有指定鍵名。 | | `PHPUnit_Framework_Constraint_TraversableContains contains(mixed $value)` | 此約束斷言所評定的 `array` 或實現了 `Iterator` 接口的對象包含有給定值。 | | `PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnly(string $type)` | 此約束斷言所評定的 `array` 或實現了 `Iterator` 接口的對象僅包含給定類型的值。 | | `PHPUnit_Framework_Constraint_TraversableContainsOnly containsOnlyInstancesOf(string $classname)` | 此約束斷言所評定的 `array` 或實現了 `Iterator` 接口的對象僅包含給定類名的類的實例。 | | `PHPUnit_Framework_Constraint_IsEqual equalTo($value, $delta = 0, $maxDepth = 10)` | 此約束檢驗一個值是否等于另外一個。 | | `PHPUnit_Framework_Constraint_Attribute attributeEqualTo($attributeName, $value, $delta = 0, $maxDepth = 10)` | 此約束檢驗一個值是否等于某個類或對象的某個屬性。 | | `PHPUnit_Framework_Constraint_FileExists fileExists()` | 此約束檢驗所評定的文件名對應的文件是否存在。 | | `PHPUnit_Framework_Constraint_GreaterThan greaterThan(mixed $value)` | 此約束斷言所評定的值大于給定值。 | | `PHPUnit_Framework_Constraint_Or greaterThanOrEqual(mixed $value)` | 此約束斷言所評定的值大于或等于給定值。 | | `PHPUnit_Framework_Constraint_ClassHasAttribute classHasAttribute(string $attributeName)` | 此約束斷言所評定的類具有給定屬性。 | | `PHPUnit_Framework_Constraint_ClassHasStaticAttribute classHasStaticAttribute(string $attributeName)` | 此約束斷言所評定的類具有給定靜態屬性。 | | `PHPUnit_Framework_Constraint_ObjectHasAttribute hasAttribute(string $attributeName)` | 此約束斷言所評定的對象具有給定屬性。 | | `PHPUnit_Framework_Constraint_IsIdentical identicalTo(mixed $value)` | 此約束斷言所評定的值與另外一個值全等。 | | `PHPUnit_Framework_Constraint_IsFalse isFalse()` | 此約束斷言所評定的值為 `FALSE`。 | | `PHPUnit_Framework_Constraint_IsInstanceOf isInstanceOf(string $className)` | 此約束斷言所評定的對象是給定類的實例。 | | `PHPUnit_Framework_Constraint_IsNull isNull()` | 此約束斷言所評定的值為 `NULL`。 | | `PHPUnit_Framework_Constraint_IsTrue isTrue()` | 此約束斷言所評定的值為 `TRUE`。 | | `PHPUnit_Framework_Constraint_IsType isType(string $type)` | 此約束斷言所評定的值是指定類型的。 | | `PHPUnit_Framework_Constraint_LessThan lessThan(mixed $value)` | 此約束斷言所評定的值小于給定值。 | | `PHPUnit_Framework_Constraint_Or lessThanOrEqual(mixed $value)` | 此約束斷言所評定的值小于或等于給定值。 | | `logicalAnd()` | 邏輯與(AND)。 | | `logicalNot(PHPUnit_Framework_Constraint $constraint)` | 邏輯非(NOT)。 | | `logicalOr()` | 邏輯或(OR)。 | | `logicalXor()` | 邏輯異或(XOR)。 | | `PHPUnit_Framework_Constraint_PCREMatch matchesRegularExpression(string $pattern)` | 此約束斷言所評定的字符串匹配于正則表達式。 | | `PHPUnit_Framework_Constraint_StringContains stringContains(string $string, bool $case)` | 此約束斷言所評定的字符串包含指定字符串。 | | `PHPUnit_Framework_Constraint_StringEndsWith stringEndsWith(string $suffix)` | 此約束斷言所評定的字符串以給定后綴結尾。 | | `PHPUnit_Framework_Constraint_StringStartsWith stringStartsWith(string $prefix)` | 此約束斷言所評定的字符串以給定前綴開頭。 |
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看