public function testListTemplates() { $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $handlers['record'] = $this->getMockHandler('RecordHandler', 'listTemplates'); $twig = new TwigExtension($app, $handlers, true); $twig->listTemplates(null, null); }
public function testListTemplates() { $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $twig = new TwigExtension($app, $handlers, false); $templates = $twig->listTemplates(); $this->assertNotEmpty($templates); $filtered = $twig->listTemplates('index*'); $this->assertGreaterThan(0, count($filtered)); // Test safe mode does nothing $app = $this->getApp(); $handlers = $this->getTwigHandlers($app); $twig = new TwigExtension($app, $handlers, true); $this->assertNull($twig->listTemplates()); }