You are here

public function Twig_Tests_ParserTest::testParseIsReentrant in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/twig/twig/test/Twig/Tests/ParserTest.php \Twig_Tests_ParserTest::testParseIsReentrant()

File

vendor/twig/twig/test/Twig/Tests/ParserTest.php, line 95

Class

Twig_Tests_ParserTest

Code

public function testParseIsReentrant() {
  $twig = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'), array(
    'autoescape' => false,
    'optimizations' => 0,
  ));
  $twig
    ->addTokenParser(new TestTokenParser());
  $parser = new Twig_Parser($twig);
  $parser
    ->parse(new Twig_TokenStream(array(
    new Twig_Token(Twig_Token::BLOCK_START_TYPE, '', 1),
    new Twig_Token(Twig_Token::NAME_TYPE, 'test', 1),
    new Twig_Token(Twig_Token::BLOCK_END_TYPE, '', 1),
    new Twig_Token(Twig_Token::VAR_START_TYPE, '', 1),
    new Twig_Token(Twig_Token::NAME_TYPE, 'foo', 1),
    new Twig_Token(Twig_Token::VAR_END_TYPE, '', 1),
    new Twig_Token(Twig_Token::EOF_TYPE, '', 1),
  )));
  $this
    ->assertNull($parser
    ->getParent());
}