FUnit::error_handler PHP Method

error_handler() public static method

custom error handler to catch errors triggered while running tests. this is registered at the start of FUnit::run() and deregistered at stop
See also: FUnit::run()
public static error_handler ( $num, $msg, $file, $line, $vars )
    public static function error_handler($num, $msg, $file, $line, $vars)
    {
        $datetime = date("Y-m-d H:i:s (T)");
        $types = array(E_ERROR => 'Error', E_WARNING => 'Warning', E_PARSE => 'Parsing Error', E_NOTICE => 'Notice', E_CORE_ERROR => 'Core Error', E_CORE_WARNING => 'Core Warning', E_COMPILE_ERROR => 'Compile Error', E_COMPILE_WARNING => 'Compile Warning', E_USER_ERROR => 'User Error', E_USER_WARNING => 'User Warning', E_USER_NOTICE => 'User Notice', E_STRICT => 'Runtime Notice', E_RECOVERABLE_ERROR => 'Catchable Fatal Error');
        $type = $types[$num];
        $bt_raw = debug_backtrace();
        array_shift($bt_raw);
        $backtrace = static::parse_backtrace($bt_raw);
        $edata = compact('datetime', 'num', 'type', 'msg', 'file', 'line', 'backtrace');
        FUnit::add_error_data($edata);
    }