added some missing tests for nested blocks
authorFabien Potencier <fabien.potencier@gmail.com>
Fri, 20 Apr 2012 08:53:54 +0000 (10:53 +0200)
committerFabien Potencier <fabien.potencier@gmail.com>
Fri, 20 Apr 2012 08:56:03 +0000 (10:56 +0200)
test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test [new file with mode: 0644]
test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test [new file with mode: 0644]

diff --git a/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test b/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test
new file mode 100644 (file)
index 0000000..faca925
--- /dev/null
@@ -0,0 +1,22 @@
+--TEST--
+"block" tag
+--TEMPLATE--
+{% extends "foo.twig" %}
+
+{% block content %}
+    {% block subcontent %}
+        {% block subsubcontent %}
+            SUBSUBCONTENT
+        {% endblock %}
+    {% endblock %}
+{% endblock %}
+--TEMPLATE(foo.twig)--
+{% block content %}
+    {% block subcontent %}
+        SUBCONTENT
+    {% endblock %}
+{% endblock %}
+--DATA--
+return array()
+--EXPECT--
+SUBSUBCONTENT
diff --git a/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test b/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test
new file mode 100644 (file)
index 0000000..0ad11d0
--- /dev/null
@@ -0,0 +1,15 @@
+--TEST--
+"block" tag
+--TEMPLATE--
+{% block content %}
+    CONTENT
+    {%- block subcontent -%}
+        SUBCONTENT
+    {%- endblock -%}
+    ENDCONTENT
+{% endblock %}
+--TEMPLATE(foo.twig)--
+--DATA--
+return array()
+--EXPECT--
+CONTENTSUBCONTENTENDCONTENT