listTemplates() public method

See also: Bolt\Twig\Handler\RecordHandler::listTemplates()
public listTemplates ( $filter = '' )
Example #1
0
 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);
 }
Example #2
0
 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());
 }