/** * @dataProvider providerTestPrepareStep * @param HtmlHelper $helper * @param \Exception|\Throwable $exception */ public function testPrepareStep(HtmlHelper $helper, $exception) { foreach ($exception->getTrace() as $step) { $colorized = $helper->prepareStep($step); $this->assertTrue(is_array($colorized)); foreach (array('title', 'source', 'key', 'arguments') as $key) { $this->assertTrue(isset($colorized[$key])); } $this->assertTrue(is_array($colorized['arguments'])); } }
public function displayException($exception) { $exceptions = new Exceptions(); $exceptions->throwIfIsNotThrowable($exception); $vars = array('exception' => $exception, 'exceptionClass' => get_class($exception), 'message' => $exception->getMessage(), 'trace' => array(), '__static' => array('css' => array($this->bootstrapCss), 'js' => array($this->jqueryJs, $this->bootstrapJs))); $helper = new HtmlHelper($this->varDumpFn, $this->editor); $vars['trace'][] = $helper->prepareStep(array('file' => $exception->getFile(), 'line' => $exception->getLine())); foreach ($exception->getTrace() as $rawStep) { $vars['trace'][] = $helper->prepareStep($rawStep); } $template = new Template(); fputs($this->outputStream, $template->render('exceptions/html', $vars)); }