Commit f1506215 authored by Côme Chilliet's avatar Côme Chilliet
Browse files

Adding a define to turn PHP errors into fatal errors when testing with selenium

Showing with 9 additions and 1 deletion
+9 -1
......@@ -259,7 +259,10 @@ function gosaRaiseError($errno, $errstr, $errfile, $errline)
/* Flush in case of fatal errors */
set_error_handler('gosaRaiseError', E_WARNING | E_NOTICE | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_STRICT);
if (preg_match('/^fatal/i', $errstr)) {
if (preg_match('/^fatal/i', $errstr) || (PHP_ERROR_FATAL == 'TRUE')) {
if (PHP_ERROR_FATAL == 'TRUE') {
$error_collector = str_replace('display: none;', '', $error_collector);
}
echo $error_collector."</div>";
flush();
exit;
......
......@@ -75,4 +75,9 @@ define ("CONFIGRDN", "cn=config,ou=fusiondirectory,"); /*! Define FusionDirector
*/
define ("PHP_MIN_VERSION", "5.4.0");
/*!
* \brief Toggle crashing on PHP error, used for test suites
*/
define ('PHP_ERROR_FATAL', 'FALSE');
?>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment