You are here

public function Twig_Tests_Loader_FilesystemTest::testFindTemplateWithCache in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php \Twig_Tests_Loader_FilesystemTest::testFindTemplateWithCache()

File

vendor/twig/twig/test/Twig/Tests/Loader/FilesystemTest.php, line 119

Class

Twig_Tests_Loader_FilesystemTest

Code

public function testFindTemplateWithCache() {
  $basePath = dirname(__FILE__) . '/Fixtures';
  $loader = new Twig_Loader_Filesystem(array(
    $basePath . '/normal',
  ));
  $loader
    ->addPath($basePath . '/named', 'named');

  // prime the cache for index.html in the named namespace
  $namedSource = $loader
    ->getSource('@named/index.html');
  $this
    ->assertEquals("named path\n", $namedSource);

  // get index.html from the main namespace
  $this
    ->assertEquals("path\n", $loader
    ->getSource('index.html'));
}