You are here

public function Twig_Tests_NodeVisitor_OptimizerTest::testRenderVariableBlockOptimizer in Zircon Profile 8.0

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

File

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

Class

Twig_Tests_NodeVisitor_OptimizerTest

Code

public function testRenderVariableBlockOptimizer() {
  if (PHP_VERSION_ID >= 50400) {
    return;
  }
  $env = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'), array(
    'cache' => false,
    'autoescape' => false,
  ));
  $stream = $env
    ->parse($env
    ->tokenize('{{ block(name|lower) }}', 'index'));
  $node = $stream
    ->getNode('body')
    ->getNode(0)
    ->getNode(1);
  $this
    ->assertEquals('Twig_Node_Expression_BlockReference', get_class($node));
  $this
    ->assertTrue($node
    ->getAttribute('output'));
}