You are here

public function Twig_Tests_ExpressionParserTest::testArrayExpression in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php \Twig_Tests_ExpressionParserTest::testArrayExpression()

@dataProvider getTestsForArray

File

vendor/twig/twig/test/Twig/Tests/ExpressionParserTest.php, line 42

Class

Twig_Tests_ExpressionParserTest

Code

public function testArrayExpression($template, $expected) {
  $env = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'), array(
    'cache' => false,
    'autoescape' => false,
  ));
  $stream = $env
    ->tokenize($template, 'index');
  $parser = new Twig_Parser($env);
  $this
    ->assertEquals($expected, $parser
    ->parse($stream)
    ->getNode('body')
    ->getNode(0)
    ->getNode('expr'));
}