First of all, codeception’s unit testing is quite strict
Docs attached: http://codeception.com/docs/0... (No relevant configuration can be found here)
When:
$a = [0];
$I->assertEmpty($a[1]);
Unit tests will be interrupted when
Prompt: [PHPUnit_Framework_Exception] Undefined offset: 1
I know that phpunit.xml can set convertNoticesToExceptions to false
but codeception cannot find the relevant settings
And when I asked the author a question, he just gave advice not to write "sloppy coding" and it did not solve my problem.
I cannot guarantee that there will not be similar Notice errors in every location, nor can I guarantee that the framework I use will not have such errors, and it is precisely because of errors in the existing framework that I cannot write tests.
Now I want to use codeception for unit testing. How can I skip Notice and Warning level errors and prevent them from being converted into Exception and thrown? ?
Find the solution!
http://php.net/manual/zh/func...
Just set error_reporting