• <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>
  • 教你一步一步寫一個phpunit testcase(11)

    發表于:2017-06-01來源:葉左左作者:葉左左點擊數: 標簽:PHPUnit
    Q:如果testReserve()執行失敗,testUnReserve()會執行嗎? A:是不會的,當被依賴的測試案例如果測試失敗,那依賴的測試就會忽略執行。 我們可以試著將

    Q:如果testReserve()執行失敗,testUnReserve()會執行嗎?

    A:是不會的,當被依賴的測試案例如果測試失敗,那依賴的測試就會忽略執行。

    我們可以試著將testReserve()故意測試失敗,只需要針對事件物件的getAttendNumber()斷言的預期值,從1改成0就可以讓testReserve()測試失敗,接著再執行測試:

    ?  how-to-write-a-phpunit-testcase git:(master) ? phpunit --bootstrap vendor/autoload.php tests/EventTest.php
    PHPUnit 5.4.8 by Sebastian Bergmann and contributors.
    
    FS..
    
    Time: 110 ms, Memory: 10.00MB
    
    There was 1 failure:
    
    1) EventTest::testReserve
    Failed asserting that 1 matches expected 0.
    
    /Users/wangzhihao/git/how-to-write-a-phpunit-testcase/tests/EventTest.php:52
    
    FAILURES!
    Tests: 4, Assertions: 14, Failures: 1, Skipped: 1.

    Data Providers(數據提供者)

    數據提供者,能提供多次的測試數據進行多次的測試。

    原文轉自:http://www.jianshu.com/p/ba6829a6f3ec

    老湿亚洲永久精品ww47香蕉图片_日韩欧美中文字幕北美法律_国产AV永久无码天堂影院_久久婷婷综合色丁香五月

  • <ruby id="5koa6"></ruby>
    <ruby id="5koa6"><option id="5koa6"><thead id="5koa6"></thead></option></ruby>

    <progress id="5koa6"></progress>

  • <strong id="5koa6"></strong>