test the return value of a method that triggers an error with PHPUnit

前端 未结 5 1612
自闭症患者
自闭症患者 2020-12-16 17:33

This question is specific to using PHPUnit.

PHPUnit automatically converts php errors to exceptions. Is there a way to test the return value of a method that

5条回答
  •  无人及你
    2020-12-16 18:01

    Use a phpunit.xml configuration file and disable the notice/warning/error to Exception conversion. More details in the manual. It's basically something like this:

    
    
    

提交回复
热议问题