Merge branch '1.x' into 2.x

* 1.x:
  added some tests
This commit is contained in:
Fabien Potencier
2019-05-16 21:02:31 +02:00
2 changed files with 21 additions and 2 deletions
@@ -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.