From 45e167a514ff0d53878be6a7c145336ccfdc4f03 Mon Sep 17 00:00:00 2001 From: Fabien Potencier Date: Mon, 9 Sep 2024 08:41:21 +0200 Subject: [PATCH] Add more tests --- .../inheritance/conditional_block_nested.test | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 tests/Fixtures/tags/inheritance/conditional_block_nested.test diff --git a/tests/Fixtures/tags/inheritance/conditional_block_nested.test b/tests/Fixtures/tags/inheritance/conditional_block_nested.test new file mode 100644 index 00000000000..1f99dfb6167 --- /dev/null +++ b/tests/Fixtures/tags/inheritance/conditional_block_nested.test @@ -0,0 +1,38 @@ +--TEST-- +conditional "block" tag with "extends" tag (nested) +--TEMPLATE-- +{% extends "layout.twig" %} + +{% block content_base %} + {{ parent() -}} + index +{% endblock %} + +{% block content_layout -%} + {{ parent() -}} + nested_index +{% endblock %} +--TEMPLATE(layout.twig)-- +{% extends "base.twig" %} + +{% block content_base %} + {{ parent() -}} + layout + {% if true -%} + {% block content_layout -%} + nested_layout + {% endblock -%} + {% endif %} +{% endblock %} +--TEMPLATE(base.twig)-- +{% block content_base %} + base +{% endblock %} +--DATA-- +return [] +--EXPECT-- +base +layout + nested_layout + nested_index +index