MDL-46514 behat: Catch php errors in shutdown hook

If error is not displayed in web browser then
it will be caught in shutdown hook, so we can
show it to user
This commit is contained in:
Rajesh Taneja
2016-08-23 15:14:38 +08:00
parent 39eb8abe15
commit 0c1bcb63c6
3 changed files with 106 additions and 25 deletions
+6
View File
@@ -1038,6 +1038,12 @@ if (isset($CFG->maintenance_later) and $CFG->maintenance_later <= time()) {
}
}
// Add behat_shutdown_function to shutdown manager, so we can capture php errors,
// but not necessary for behat CLI command as it's being captured by behat process.
if (defined('BEHAT_SITE_RUNNING') && !defined('BEHAT_TEST')) {
core_shutdown_manager::register_function('behat_shutdown_function');
}
// note: we can not block non utf-8 installations here, because empty mysql database
// might be converted to utf-8 in admin/index.php during installation