コード例 #1
0
 public function testAll()
 {
     $template = new Template();
     $template->setRootDirectory(__DIR__);
     $output = $template->render('template', array('value' => 5 * 5));
     $this->assertSame('5 * 5 = 25', $output);
 }
コード例 #2
0
ファイル: Html.php プロジェクト: bkrukowski/error-dumper
 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));
 }