1 error_test.module | error_test_generate_warnings($collect_errors = FALSE) |
Menu callback; generate warnings to test the error handler.
File
- core/
modules/ simpletest/ tests/ error_test.module, line 39
Code
function error_test_generate_warnings($collect_errors = FALSE) {
// Tell Backdrop error reporter to send errors to Simpletest or not.
define('SIMPLETEST_COLLECT_ERRORS', $collect_errors);
// This will generate a notice.
$notice = new \stdClass();
$notice == 1 ? 1 : 0;
// This will generate a warning.
$a = '';
foreach ($a as $b) {
}
// This will generate a user error.
trigger_error("Backdrop is awesome", E_USER_WARNING);
return "";
}