public function Twig_Tests_LexerTest::testStringWithNestedInterpolationsInBlock

File

drupal/core/vendor/twig/twig/test/Twig/Tests/LexerTest.php, line 221

Class

Twig_Tests_LexerTest

Code

public function testStringWithNestedInterpolationsInBlock() {
  $template = '{% foo "bar #{ "foo#{bar}" }" %}';
  $lexer = new Twig_Lexer(new Twig_Environment());
  $stream = $lexer
    ->tokenize($template);
  $stream
    ->expect(Twig_Token::BLOCK_START_TYPE);
  $stream
    ->expect(Twig_Token::NAME_TYPE, 'foo');
  $stream
    ->expect(Twig_Token::STRING_TYPE, 'bar ');
  $stream
    ->expect(Twig_Token::INTERPOLATION_START_TYPE);
  $stream
    ->expect(Twig_Token::STRING_TYPE, 'foo');
  $stream
    ->expect(Twig_Token::INTERPOLATION_START_TYPE);
  $stream
    ->expect(Twig_Token::NAME_TYPE, 'bar');
  $stream
    ->expect(Twig_Token::INTERPOLATION_END_TYPE);
  $stream
    ->expect(Twig_Token::INTERPOLATION_END_TYPE);
  $stream
    ->expect(Twig_Token::BLOCK_END_TYPE);
}