You are here

public function Twig_Tests_ExpressionParserTest::testMacroDefinitionDoesNotSupportNonNameVariableName in Zircon Profile 8

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

@expectedException Twig_Error_Syntax @expectedExceptionMessage An argument must be a name. Unexpected token "string" of value "a" ("name" expected) in "index" at line 1

File

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

Class

Twig_Tests_ExpressionParserTest

Code

public function testMacroDefinitionDoesNotSupportNonNameVariableName() {
  $env = new Twig_Environment($this
    ->getMock('Twig_LoaderInterface'), array(
    'cache' => false,
    'autoescape' => false,
  ));
  $parser = new Twig_Parser($env);
  $parser
    ->parse($env
    ->tokenize('{% macro foo("a") %}{% endmacro %}', 'index'));
}