PHPUnit - assertion failed but I want to continue testing

后端 未结 4 1335
余生分开走
余生分开走 2021-02-07 10:59
->assertTrue(false);
->assertTrue(true);

First assertion was failed and execution was stopped. But I want to continue the further snippet of code

4条回答
  •  忘了有多久
    2021-02-07 11:19

    I'm late to the party, but I recommend using a configuration file for the test suites to achieve this easily.

    You can create phpunit.xml file from where you are running the phpunit test. Hence phpunit will run the needed tests listed there.

    PHPUnit 3.7.38 by Sebastian Bergmann.

    Configuration read from /path/phpunit.xml

    In that file you can specify that you don't want to stop on failure.

    
      
        
          tests/ClassTest.php
        
      
    
    

    Hope this helps.

提交回复
热议问题