You are here

public function Twig_Tests_Loader_FilesystemTest::testLoadTemplateAndRenderBlockWithCache 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::testLoadTemplateAndRenderBlockWithCache()

File

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

Class

Twig_Tests_Loader_FilesystemTest

Code

public function testLoadTemplateAndRenderBlockWithCache() {
  $loader = new Twig_Loader_Filesystem(array());
  $loader
    ->addPath(dirname(__FILE__) . '/Fixtures/themes/theme2');
  $loader
    ->addPath(dirname(__FILE__) . '/Fixtures/themes/theme1');
  $loader
    ->addPath(dirname(__FILE__) . '/Fixtures/themes/theme1', 'default_theme');
  $twig = new Twig_Environment($loader);
  $template = $twig
    ->loadTemplate('blocks.html.twig');
  $this
    ->assertSame('block from theme 1', $template
    ->renderBlock('b1', array()));
  $template = $twig
    ->loadTemplate('blocks.html.twig');
  $this
    ->assertSame('block from theme 2', $template
    ->renderBlock('b2', array()));
}