public function testPrintBacktrace() { $this->stubVarDumper(); // First test with debug off $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $twig = new TwigExtension($app, $handlers, false); $app['debug'] = false; $this->assertNull($twig->printBacktrace()); // Safe mode test $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $twig = new TwigExtension($app, $handlers, true); $this->assertNull($twig->printBacktrace()); // Debug mode $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $twig = new TwigExtension($app, $handlers, false); $this->assertNotEmpty($twig->printBacktrace()); }
public function testPrintBacktrace() { $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $handlers['utils'] = $this->getMockHandler('UtilsHandler', 'printBacktrace'); $twig = new TwigExtension($app, $handlers, true); $twig->printBacktrace(null, null); }