fileExists() public method

See also: Bolt\Twig\Handler\UtilsHandler::fileExists()
public fileExists ( $fn )
Example #1
0
 public function testFileExists()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, false);
     $this->assertTrue($twig->fileExists(__FILE__));
     // Test safe returns false
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $twig = new TwigExtension($app, $handlers, true);
     $this->assertFalse($twig->fileExists(__FILE__));
 }
Example #2
0
 public function testFileExists()
 {
     $app = $this->getApp();
     $handlers = $this->getTwigHandlers($app);
     $handlers['utils'] = $this->getMockHandler('UtilsHandler', 'fileExists');
     $twig = new TwigExtension($app, $handlers, true);
     $twig->fileExists(null, null);
 }