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); }
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')); }