From 6cf147dc99574c75844933e298558777cc3fa194 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Fri, 20 Apr 2012 10:53:54 +0200 Subject: [PATCH] added some missing tests for nested blocks --- .../Fixtures/tags/inheritance/nested_blocks.test | 22 ++++++++++++++++++++ .../inheritance/nested_blocks_parent_only.test | 15 +++++++++++++ 2 files changed, 37 insertions(+), 0 deletions(-) create mode 100644 test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test create mode 100644 test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test 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 index 0000000..faca925 --- /dev/null +++ b/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks.test @@ -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 index 0000000..0ad11d0 --- /dev/null +++ b/test/Twig/Tests/Fixtures/tags/inheritance/nested_blocks_parent_only.test @@ -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 -- 1.7.2.5