lithium\test\Unit::_reportException PHP Метод

_reportException() защищенный Метод

Convert an exception object to an exception result array for test reporting.
protected _reportException ( array $exception, string $lineFlag = null ) : void
$exception array The exception data to report on. Statistics are gathered and added to the reporting stack contained in `Unit::$_results`.
$lineFlag string
Результат void
    protected function _reportException($exception, $lineFlag = null)
    {
        $message = $exception['message'];
        $isExpected = ($exp = end($this->_expected)) && ($exp === true || $exp === $message || Validator::isRegex($exp) && preg_match($exp, $message));
        if ($isExpected) {
            return array_pop($this->_expected);
        }
        $initFrame = current($exception['trace']) + array('class' => '-', 'function' => '-');
        foreach ($exception['trace'] as $frame) {
            if (isset($scopedFrame)) {
                break;
            }
            if (!class_exists('lithium\\analysis\\Inspector')) {
                continue;
            }
            if (isset($frame['class']) && in_array($frame['class'], Inspector::parents($this))) {
                $scopedFrame = $frame;
            }
        }
        if (class_exists('lithium\\analysis\\Debugger')) {
            $exception['trace'] = Debugger::trace(array('trace' => $exception['trace'], 'format' => '{:functionRef}, line {:line}', 'includeScope' => false, 'scope' => array_filter(array('functionRef' => __NAMESPACE__ . '\\{closure}', 'line' => $lineFlag))));
        }
        $this->_result('exception', $exception + array('class' => $initFrame['class'], 'method' => $initFrame['function']));
    }