mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 02:46:29 +00:00
added some tests
This commit is contained in:
+4
-2
@@ -1,7 +1,9 @@
|
||||
--TEST--
|
||||
"from" tag with syntax error
|
||||
--TEMPLATE--
|
||||
{% from _self import another %}
|
||||
{% from _self import another, foo %}
|
||||
|
||||
{{ foo() }}
|
||||
|
||||
{% macro foo() %}
|
||||
{{ another() }}
|
||||
@@ -12,4 +14,4 @@
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig\Error\SyntaxError: Unknown "another" function in "index.twig" at line 5.
|
||||
Twig\Error\SyntaxError: Unknown "another" function in "index.twig" at line 7.
|
||||
@@ -0,0 +1,17 @@
|
||||
--TEST--
|
||||
"import" tag with syntax error
|
||||
--TEMPLATE--
|
||||
{% import _self as foo %}
|
||||
|
||||
{{ foo.foo() }}
|
||||
|
||||
{% macro foo() %}
|
||||
{{ foo.another() }}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro another() %}
|
||||
{% endmacro %}
|
||||
--DATA--
|
||||
return []
|
||||
--EXCEPTION--
|
||||
Twig\Error\RuntimeError: Variable "foo" does not exist in "index.twig" at line 7.
|
||||
Reference in New Issue
Block a user