mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-09 00:46:31 +00:00
fixed tests for errors
This commit is contained in:
@@ -12,4 +12,4 @@ Content outside a block.
|
||||
{% block sidebar %}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3?
|
||||
Twig\Error\SyntaxError: A template that extends another one cannot include content outside Twig blocks. Did you forget to put the content inside a {% block %} tag in "index.twig" at line 3?
|
||||
|
||||
@@ -15,4 +15,4 @@ Exception for multiline array with undefined variable
|
||||
--DATA--
|
||||
return ['foobar' => 'foobar']
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "foo2" does not exist in "index.twig" at line 11.
|
||||
Twig\Error\RuntimeError: Variable "foo2" does not exist in "index.twig" at line 11.
|
||||
|
||||
+1
-1
@@ -15,4 +15,4 @@ Exception for multiline array with undefined variable
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "foobar" does not exist in "index.twig" at line 7.
|
||||
Twig\Error\RuntimeError: Variable "foobar" does not exist in "index.twig" at line 7.
|
||||
|
||||
@@ -9,4 +9,4 @@ Foo
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "with_context" does not exist in "index.twig" at line 3.
|
||||
Twig\Error\RuntimeError: Variable "with_context" does not exist in "index.twig" at line 3.
|
||||
|
||||
@@ -6,4 +6,4 @@ Exception for multiline function with unknown argument
|
||||
invalid=False
|
||||
) }}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4.
|
||||
Twig\Error\SyntaxError: Unknown argument "invalid" for function "include(template, variables, with_context, ignore_missing, sandboxed)" in "index.twig" at line 4.
|
||||
|
||||
@@ -9,4 +9,4 @@ Foo
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "vars" does not exist in "index.twig" at line 3.
|
||||
Twig\Error\RuntimeError: Variable "vars" does not exist in "index.twig" at line 3.
|
||||
|
||||
@@ -3,4 +3,4 @@ The PHP === strict comparison operator is not supported
|
||||
--TEMPLATE--
|
||||
{{ 1 === 2 }}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: Unexpected operator of value "=". Did you try to use "===" or "!==" for strict comparison? Use "is same as(value)" instead in "index.twig" at line 2.
|
||||
|
||||
@@ -7,4 +7,4 @@ Exception for syntax error in reused template
|
||||
{% do node.data = 5 %}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3.
|
||||
Twig\Error\SyntaxError: Unexpected token "operator" of value "=" ("end of statement block" expected) in "foo.twig" at line 3.
|
||||
|
||||
@@ -17,4 +17,4 @@ Exception for an unclosed tag
|
||||
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected "endblock" tag (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16.
|
||||
Twig\Error\SyntaxError: Unexpected "endblock" tag (expecting closing tag for the "if" tag defined near line 4) in "index.twig" at line 16.
|
||||
|
||||
@@ -5,4 +5,4 @@ Exception for an undefined parent
|
||||
|
||||
{% set foo = "foo" %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "foo.html" is not defined in "index.twig" at line 2.
|
||||
Twig\Error\LoaderError: Template "foo.html" is not defined in "index.twig" at line 2.
|
||||
|
||||
@@ -12,4 +12,4 @@ Exception for an undefined template in a child template
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "include.twig" is not defined in "index.twig" at line 5.
|
||||
Twig\Error\LoaderError: Template "include.twig" is not defined in "index.twig" at line 5.
|
||||
|
||||
@@ -6,4 +6,4 @@ Exception for an undefined trait
|
||||
{% block bar %}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2.
|
||||
Twig\Error\RuntimeError: Block "foobar" is not defined in trait "foo" in "index.twig" at line 2.
|
||||
|
||||
@@ -5,4 +5,4 @@ Twig does not allow to use two-word named operators as variable names
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected token "operator" of value "starts with" in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: Unexpected token "operator" of value "starts with" in "index.twig" at line 2.
|
||||
|
||||
@@ -5,4 +5,4 @@ Exception for invalid argument type in replace call
|
||||
--DATA--
|
||||
return ['stdClass' => new \stdClass()]
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2.
|
||||
Twig\Error\RuntimeError: The "replace" filter expects an array or "Traversable" as replace values, got "stdClass" in "index.twig" at line 2.
|
||||
|
||||
@@ -9,4 +9,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: The "block" function takes one argument (the block name) in "base.twig" at line 2.
|
||||
Twig\Error\SyntaxError: The "block" function takes one argument (the block name) in "base.twig" at line 2.
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
|
||||
Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2.
|
||||
|
||||
@@ -13,4 +13,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
|
||||
Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3.
|
||||
|
||||
@@ -10,4 +10,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Sandbox_SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4.
|
||||
Twig\Sandbox\SecurityNotAllowedFilterError: Filter "e" is not allowed in "foo.twig" at line 4.
|
||||
|
||||
@@ -4,4 +4,4 @@ macro with varargs argument
|
||||
{% macro test(varargs) %}
|
||||
{% endmacro %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: The argument "varargs" in macro "test" cannot be defined because the variable "varargs" is reserved for arbitrary arguments in "index.twig" at line 2.
|
||||
|
||||
@@ -12,4 +12,4 @@ foo
|
||||
--DATA--
|
||||
return ['foo' => 'foo']
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3.
|
||||
Twig\Error\RuntimeError: Impossible to access an attribute ("bar") on a string variable ("foo") in "foo" at line 3.
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: The block 'content' has already been defined line 2 in "index.twig" at line 3.
|
||||
Twig\Error\SyntaxError: The block 'content' has already been defined line 2 in "index.twig" at line 3.
|
||||
|
||||
@@ -13,4 +13,4 @@ BAR
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5.
|
||||
Twig\Error\RuntimeError: Variable "nothing" does not exist in "index.twig" at line 5.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return ['items' => ['a', 'b']]
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3.
|
||||
Twig\Error\SyntaxError: The "loop.last" variable is not defined when looping with a condition in "index.twig" at line 3.
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
--DATA--
|
||||
return ['items' => ['a', 'b']]
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: The "loop" variable cannot be used in a looping condition in "index.twig" at line 2.
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "foo.twig" is not defined in "index.twig" at line 2.
|
||||
Twig\Error\LoaderError: Template "foo.twig" is not defined in "index.twig" at line 2.
|
||||
|
||||
@@ -13,4 +13,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Loader: Template "foo.twig" is not defined in "base.twig" at line 3.
|
||||
Twig\Error\LoaderError: Template "foo.twig" is not defined in "base.twig" at line 3.
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
{% extends "foo.twig" %}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Cannot extend from a block in "index.twig" at line 3.
|
||||
Twig\Error\SyntaxError: Cannot extend from a block in "index.twig" at line 3.
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3.
|
||||
Twig\Error\SyntaxError: Calling "parent" on a template that does not extend nor "use" another template is forbidden in "index.twig" at line 3.
|
||||
|
||||
@@ -6,4 +6,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: "templateName" cannot be an imported macro as it is a reserved keyword in "index.twig" at line 2.
|
||||
|
||||
@@ -8,4 +8,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4.
|
||||
Twig\Error\SyntaxError: "parent" cannot be called as macro as it is a reserved keyword in "index.twig" at line 4.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: "parent" cannot be used as a macro name as it is a reserved keyword in "index.twig" at line 2.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: Unexpected end of file: Unclosed "raw" block in "index.twig" at line 2.
|
||||
|
||||
@@ -8,4 +8,4 @@ sandbox tag
|
||||
--TEMPLATE(foo.twig)--
|
||||
foo
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4.
|
||||
Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 4.
|
||||
|
||||
@@ -11,4 +11,4 @@ sandbox tag
|
||||
--TEMPLATE(foo.twig)--
|
||||
foo
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5.
|
||||
Twig\Error\SyntaxError: Only "include" tags are allowed within a "sandbox" section in "index.twig" at line 5.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig_Error_Syntax: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2.
|
||||
Twig\Error\SyntaxError: Unexpected end of file: Unclosed "verbatim" block in "index.twig" at line 2.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return ['vars' => 'no-hash']
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variables passed to the "with" tag must be a hash in "index.twig" at line 2.
|
||||
Twig\Error\RuntimeError: Variables passed to the "with" tag must be a hash in "index.twig" at line 2.
|
||||
|
||||
@@ -7,4 +7,4 @@
|
||||
--DATA--
|
||||
return ['foo' => 'baz', 'baz' => 'baz']
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "baz" does not exist in "index.twig" at line 3.
|
||||
Twig\Error\RuntimeError: Variable "baz" does not exist in "index.twig" at line 3.
|
||||
|
||||
Reference in New Issue
Block a user