You are here

public function Twig_Tests_NodeVisitor_OptimizerTest::testRenderBlockOptimizer in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php \Twig_Tests_NodeVisitor_OptimizerTest::testRenderBlockOptimizer()

File

vendor/twig/twig/test/Twig/Tests/NodeVisitor/OptimizerTest.php, line 13

Class

Twig_Tests_NodeVisitor_OptimizerTest

Code

public function testRenderBlockOptimizer() {
  $env = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'), array(
    'cache' => false,
    'autoescape' => false,
  ));
  $stream = $env
    ->parse($env
    ->tokenize('{{ block("foo") }}', 'index'));
  $node = $stream
    ->getNode('body')
    ->getNode(0);
  $this
    ->assertEquals('Twig_Node_Expression_BlockReference', get_class($node));
  $this
    ->assertTrue($node
    ->getAttribute('output'));
}