Merge branch '1.x' into 2.x

* 1.x:
  added some tests
This commit is contained in:
Fabien Potencier
2019-05-17 09:44:35 +02:00
2 changed files with 56 additions and 0 deletions
@@ -0,0 +1,28 @@
--TEST--
"macro" tag
--TEMPLATE--
{%- from _self import input %}
{% block foo %}
{%- from "macros" import input %}
{{- input('username') }}
{% endblock %}
{% block bar %}
{{- input('username') }}
{% endblock %}
{% macro input(name) -%}
<input name="{{ name }}">
{% endmacro %}
--TEMPLATE(macros)--
{% macro input(name) %}
<input name="{{ name }}" value="local">
{% endmacro %}
--DATA--
return []
--EXPECT--
<input name="username" value="local">
<input name="username">
@@ -0,0 +1,28 @@
--TEST--
"macro" tag
--TEMPLATE--
{%- import _self as macros %}
{% block foo %}
{%- import "macros" as macros %}
{{- macros.input('username') }}
{% endblock %}
{% block bar %}
{{- macros.input('username') }}
{% endblock %}
{% macro input(name) -%}
<input name="{{ name }}">
{% endmacro %}
--TEMPLATE(macros)--
{% macro input(name) %}
<input name="{{ name }}" value="local">
{% endmacro %}
--DATA--
return []
--EXPECT--
<input name="username" value="local">
<input name="username">