php - How to prevent codeception from converting Notice into Exception and throwing it?
给我你的怀抱
给我你的怀抱 2017-05-16 12:58:30
0
1
622

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!

给我你的怀抱
给我你的怀抱

reply all(1)
过去多啦不再A梦

http://php.net/manual/zh/func...

Just set error_reporting

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template