20 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
29 array(
'{% set false = "foo" %}'),
30 array(
'{% set FALSE = "foo" %}'),
31 array(
'{% set true = "foo" %}'),
32 array(
'{% set TRUE = "foo" %}'),
33 array(
'{% set none = "foo" %}'),
34 array(
'{% set NONE = "foo" %}'),
35 array(
'{% set null = "foo" %}'),
36 array(
'{% set NULL = "foo" %}'),
37 array(
'{% set 3 = "foo" %}'),
38 array(
'{% set 1 + 2 = "foo" %}'),
39 array(
'{% set "bar" = "foo" %}'),
40 array(
'{% set %}{% endset %}'),
49 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
53 $this->assertEquals($expected,
$parser->parse(
$stream)->getNode(
'body')->getNode(0)->getNode(
'expr'));
62 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
71 array(
'{{ [1, "a": "b"] }}'),
72 array(
'{{ {"a": "b", 2} }}'),
157 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false,
'optimizations' => 0));
169 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false,
'optimizations' => 0));
173 $this->assertEquals($expected,
$parser->parse(
$stream)->getNode(
'body')->getNode(0)->getNode(
'expr'));
228 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
239 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
242 $parser->parse(
$env->tokenize(
new Twig_Source(
'{% from _self import foo %}{% macro foo() %}{% endmacro %}{{ foo(name="Foo") }}',
'index')));
251 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
264 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
273 array(
'{% macro foo(name = "a #{foo} a") %}{% endmacro %}'),
274 array(
'{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'),
283 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
290 $this->addToAssertionCount(1);
296 array(
'{% macro foo(name = "aa") %}{% endmacro %}'),
297 array(
'{% macro foo(name = 12) %}{% endmacro %}'),
298 array(
'{% macro foo(name = true) %}{% endmacro %}'),
299 array(
'{% macro foo(name = ["a"]) %}{% endmacro %}'),
300 array(
'{% macro foo(name = [["a"]]) %}{% endmacro %}'),
301 array(
'{% macro foo(name = {a: "a"}) %}{% endmacro %}'),
302 array(
'{% macro foo(name = {a: {b: "a"}}) %}{% endmacro %}'),
312 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
324 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
336 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
348 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
360 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
372 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
testUnknownFilterWithoutSuggestions()
Twig_Error_Syntax Unknown "foobar" filter in "index" at line 1.
getMacroDefinitionSupportsConstantDefaultValues()
testUnknownFilter()
Twig_Error_Syntax Unknown "lowe" filter.
testAttributeCallDoesNotSupportNamedArguments()
Twig_Error_Syntax
$stream
PHP stream implementation.
testCanOnlyAssignToNames($template)
Twig_Error_Syntax getFailingTestsForAssignment
testStringExpressionDoesNotConcatenateTwoConsecutiveStrings()
Twig_Error_Syntax
testArrayExpression($template, $expected)
getTestsForArray
getMacroDefinitionDoesNotSupportNonConstantDefaultValues()
testUnknownTest()
Twig_Error_Syntax Unknown "nul" test.
testStringExpression($template, $expected)
getTestsForString
testMacroDefinitionDoesNotSupportNonConstantDefaultValues($template)
Twig_Error_Syntax A default value for an argument must be a constant (a boolean, a string...
Create styles array
The data for the language used.
testUnknownFunctionWithoutSuggestions()
Twig_Error_Syntax Unknown "foobar" function in "index" at line 1.
testMacroCallDoesNotSupportNamedArguments()
Twig_Error_Syntax
testUnknownTestWithoutSuggestions()
Twig_Error_Syntax Unknown "foobar" test in "index" at line 1.
testMacroDefinitionSupportsConstantDefaultValues($template)
getMacroDefinitionSupportsConstantDefaultValues
getFailingTestsForAssignment()
Holds information about a non-compiled Twig template.
testArraySyntaxError($template)
Twig_Error_Syntax getFailingTestsForArray
getFailingTestsForArray()
Stores the Twig configuration.
testMacroDefinitionDoesNotSupportNonNameVariableName()
Twig_Error_Syntax An argument must be a name.
testUnknownFunction()
Twig_Error_Syntax Unknown "cycl" function.