Can I make PHPUnit crash if the code triggers a notification?

It seems that he does not do this by default, and I also do not see any switch.

These are PHPUnit 2.3.5 and PHP 5.2.0-8.

+3
source share
3 answers

You want to upgrade to a newer version of PHPUnit, see http://www.phpunit.de/ .

+3
source
function exception_error_handler($errno, $errstr, $errfile, $errline ) 
{
    throw new ErrorException($errstr, 0, $errno, $errfile, $errline);
}
set_error_handler("exception_error_handler");
+5
source

set_error_handler(), (PHPUnit , ). , PHPUnit, E_NOTICE, PHPUnit ( set_error_handler()) E_NOTICES .

+1
source

Source: https://habr.com/ru/post/1705303/


All Articles