Example #1
0
 public function testYmllink()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $handlers['admin'] = $this->getMockHandler('AdminHandler', 'ymllink');
     $twig = new TwigExtension($app, $handlers, true);
     $twig->ymllink(null, null);
 }
Example #2
0
 public function testYmlLink()
 {
     $app = $this->getApp();
     $this->expectOutputRegex('#Redirecting to /bolt/#');
     $app->run();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, false);
     $link = $twig->ymllink(' config.yml');
     $this->assertRegExp('#<a href="/bolt/file/edit/#', $link);
     // Test nothing happens in safe mode
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, true);
     $this->assertNull($twig->ymllink('config.yml'));
 }