<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>

                合規國際互聯網加速 OSASE為企業客戶提供高速穩定SD-WAN國際加速解決方案。 廣告
                # 錯誤相關信息的輸出 當有測試失敗時,PHPUnit 全力提供盡可能多的有助于找出問題所在的上下文信息。 **Example?2.17.?數組比較失敗時生成的錯誤相關信息輸出** ~~~ <?php class ArrayDiffTest extends PHPUnit_Framework_TestCase { public function testEquality() { $this->assertEquals( array(1,2,3 ,4,5,6), array(1,2,33,4,5,6) ); } } ?> ~~~ ~~~ phpunit ArrayDiffTest PHPUnit 5.0.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 5.25Mb There was 1 failure: 1) ArrayDiffTest::testEquality Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array ( 0 => 1 1 => 2 - 2 => 3 + 2 => 33 3 => 4 4 => 5 5 => 6 ) /home/sb/ArrayDiffTest.php:7 FAILURES! Tests: 1, Assertions: 1, Failures: 1. ~~~ 在這個例子中,數組中只有一個值不同,但其他值也都同時顯示出來,以提供關于錯誤發生的位置的上下文信息。 當生成的輸出很長而難以閱讀時,PHPUnit 將對其進行分割,并在每個差異附近提供少數幾行上下文信息。 **Example?2.18.?長數組比較失敗時生成的錯誤相關信息輸出** ~~~ <?php class LongArrayDiffTest extends PHPUnit_Framework_TestCase { public function testEquality() { $this->assertEquals( array(0,0,0,0,0,0,0,0,0,0,0,0,1,2,3 ,4,5,6), array(0,0,0,0,0,0,0,0,0,0,0,0,1,2,33,4,5,6) ); } } ?> ~~~ ~~~ phpunit LongArrayDiffTest PHPUnit 5.0.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 5.25Mb There was 1 failure: 1) LongArrayDiffTest::testEquality Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ 13 => 2 - 14 => 3 + 14 => 33 15 => 4 16 => 5 17 => 6 ) /home/sb/LongArrayDiffTest.php:7 FAILURES! Tests: 1, Assertions: 1, Failures: 1. ~~~ ## 邊緣情況 當比較失敗時,PHPUnit 為輸入值建立文本表示,然后以此進行對比。這種實現導致在差異指示中顯示出來的問題可能比實際上存在的多。 這種情況只出現在對數組或者對象使用 assertEquals 或其他“弱”比較函數時。 **Example?2.19.?當使用弱比較時在生成的差異結果中出現的邊緣情況** ~~~ <?php class ArrayWeakComparisonTest extends PHPUnit_Framework_TestCase { public function testEquality() { $this->assertEquals( array(1 ,2,3 ,4,5,6), array('1',2,33,4,5,6) ); } } ?> ~~~ ~~~ phpunit ArrayWeakComparisonTest PHPUnit 5.0.0 by Sebastian Bergmann and contributors. F Time: 0 seconds, Memory: 5.25Mb There was 1 failure: 1) ArrayWeakComparisonTest::testEquality Failed asserting that two arrays are equal. --- Expected +++ Actual @@ @@ Array ( - 0 => 1 + 0 => '1' 1 => 2 - 2 => 3 + 2 => 33 3 => 4 4 => 5 5 => 6 ) /home/sb/ArrayWeakComparisonTest.php:7 FAILURES! Tests: 1, Assertions: 1, Failures: 1. ~~~ 在這個例子中,第一個索引項中的 `1` and `'1'` 在報告中被視為不同,雖然 assertEquals 認為這兩個值是匹配的。
                  <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>

                              哎呀哎呀视频在线观看