Definition at line 12 of file ExpressionParserTest.php.
◆ getFailingTestsForArray()
Twig_Tests_ExpressionParserTest::getFailingTestsForArray |
( |
| ) |
|
◆ getFailingTestsForAssignment()
Twig_Tests_ExpressionParserTest::getFailingTestsForAssignment |
( |
| ) |
|
Definition at line 26 of file ExpressionParserTest.php.
References array.
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 %}'),
Create styles array
The data for the language used.
◆ getMacroDefinitionDoesNotSupportNonConstantDefaultValues()
Twig_Tests_ExpressionParserTest::getMacroDefinitionDoesNotSupportNonConstantDefaultValues |
( |
| ) |
|
Definition at line 270 of file ExpressionParserTest.php.
References array.
273 array(
'{% macro foo(name = "a #{foo} a") %}{% endmacro %}'),
274 array(
'{% macro foo(name = [["b", "a #{foo} a"]]) %}{% endmacro %}'),
Create styles array
The data for the language used.
◆ getMacroDefinitionSupportsConstantDefaultValues()
Twig_Tests_ExpressionParserTest::getMacroDefinitionSupportsConstantDefaultValues |
( |
| ) |
|
Definition at line 293 of file ExpressionParserTest.php.
References array.
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 %}'),
Create styles array
The data for the language used.
◆ getTestsForArray()
Twig_Tests_ExpressionParserTest::getTestsForArray |
( |
| ) |
|
◆ getTestsForString()
Twig_Tests_ExpressionParserTest::getTestsForString |
( |
| ) |
|
◆ testArrayExpression()
Twig_Tests_ExpressionParserTest::testArrayExpression |
( |
|
$template, |
|
|
|
$expected |
|
) |
| |
getTestsForArray
Definition at line 47 of file ExpressionParserTest.php.
References $env, $parser, GuzzleHttp\Psr7\$stream, $template, and array.
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'));
Default parser implementation.
$stream
PHP stream implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testArraySyntaxError()
Twig_Tests_ExpressionParserTest::testArraySyntaxError |
( |
|
$template | ) |
|
◆ testAttributeCallDoesNotSupportNamedArguments()
Twig_Tests_ExpressionParserTest::testAttributeCallDoesNotSupportNamedArguments |
( |
| ) |
|
◆ testCanOnlyAssignToNames()
Twig_Tests_ExpressionParserTest::testCanOnlyAssignToNames |
( |
|
$template | ) |
|
◆ testMacroCallDoesNotSupportNamedArguments()
Twig_Tests_ExpressionParserTest::testMacroCallDoesNotSupportNamedArguments |
( |
| ) |
|
Twig_Error_Syntax
Definition at line 237 of file ExpressionParserTest.php.
References $env, $parser, and array.
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')));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testMacroDefinitionDoesNotSupportNonConstantDefaultValues()
Twig_Tests_ExpressionParserTest::testMacroDefinitionDoesNotSupportNonConstantDefaultValues |
( |
|
$template | ) |
|
Twig_Error_Syntax A default value for an argument must be a constant (a boolean, a string, a number, or an array) in "index" at line 1 getMacroDefinitionDoesNotSupportNonConstantDefaultValues
Definition at line 262 of file ExpressionParserTest.php.
References $env, $parser, $template, and array.
264 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testMacroDefinitionDoesNotSupportNonNameVariableName()
Twig_Tests_ExpressionParserTest::testMacroDefinitionDoesNotSupportNonNameVariableName |
( |
| ) |
|
Twig_Error_Syntax An argument must be a name.
Unexpected token "string" of value "a" ("name" expected) in "index" at line 1.
Definition at line 249 of file ExpressionParserTest.php.
References $env, $parser, and array.
251 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testMacroDefinitionSupportsConstantDefaultValues()
Twig_Tests_ExpressionParserTest::testMacroDefinitionSupportsConstantDefaultValues |
( |
|
$template | ) |
|
getMacroDefinitionSupportsConstantDefaultValues
Definition at line 281 of file ExpressionParserTest.php.
References $env, $parser, $template, and array.
283 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
290 $this->addToAssertionCount(1);
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testStringExpression()
Twig_Tests_ExpressionParserTest::testStringExpression |
( |
|
$template, |
|
|
|
$expected |
|
) |
| |
getTestsForString
Definition at line 167 of file ExpressionParserTest.php.
References $env, $parser, GuzzleHttp\Psr7\$stream, $template, and array.
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'));
Default parser implementation.
$stream
PHP stream implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testStringExpressionDoesNotConcatenateTwoConsecutiveStrings()
Twig_Tests_ExpressionParserTest::testStringExpressionDoesNotConcatenateTwoConsecutiveStrings |
( |
| ) |
|
◆ testUnknownFilter()
Twig_Tests_ExpressionParserTest::testUnknownFilter |
( |
| ) |
|
Twig_Error_Syntax Unknown "lowe" filter.
Did you mean "lower" in "index" at line 1?
Definition at line 334 of file ExpressionParserTest.php.
References $env, $parser, and array.
336 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testUnknownFilterWithoutSuggestions()
Twig_Tests_ExpressionParserTest::testUnknownFilterWithoutSuggestions |
( |
| ) |
|
Twig_Error_Syntax Unknown "foobar" filter in "index" at line 1.
Definition at line 346 of file ExpressionParserTest.php.
References $env, $parser, and array.
348 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testUnknownFunction()
Twig_Tests_ExpressionParserTest::testUnknownFunction |
( |
| ) |
|
Twig_Error_Syntax Unknown "cycl" function.
Did you mean "cycle" in "index" at line 1?
Definition at line 310 of file ExpressionParserTest.php.
References $env, $parser, and array.
312 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testUnknownFunctionWithoutSuggestions()
Twig_Tests_ExpressionParserTest::testUnknownFunctionWithoutSuggestions |
( |
| ) |
|
Twig_Error_Syntax Unknown "foobar" function in "index" at line 1.
Definition at line 322 of file ExpressionParserTest.php.
References $env, $parser, and array.
324 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
◆ testUnknownTest()
Twig_Tests_ExpressionParserTest::testUnknownTest |
( |
| ) |
|
◆ testUnknownTestWithoutSuggestions()
Twig_Tests_ExpressionParserTest::testUnknownTestWithoutSuggestions |
( |
| ) |
|
Twig_Error_Syntax Unknown "foobar" test in "index" at line 1.
Definition at line 370 of file ExpressionParserTest.php.
References $env, $parser, and array.
372 $env =
new Twig_Environment($this->getMockBuilder(
'Twig_LoaderInterface')->getMock(),
array(
'cache' =>
false,
'autoescape' =>
false));
Default parser implementation.
Create styles array
The data for the language used.
Holds information about a non-compiled Twig template.
Stores the Twig configuration.
The documentation for this class was generated from the following file: