Skip to content

Commit

Permalink
minor #4337 Add some tests (fabpot)
Browse files Browse the repository at this point in the history
This PR was merged into the 3.x branch.

Discussion
----------

Add some tests

Closes #3691

The bug described in #3691 has been fixed via #3999.

This PR adds tests to prove it works now and to avoid future regressions.

Commits
-------

85c2ba5 Add some tests
  • Loading branch information
fabpot committed Sep 25, 2024
2 parents efc527e + 85c2ba5 commit 04f21b2
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--TEST--
"extends" tag
--TEMPLATE--
{% extends ["parent.twig"] %}

{% block outer %}
outer wrap start
{{~ parent() }}
outer wrap end
{% endblock %}

{% block inner -%}
inner actual
{% endblock %}
--TEMPLATE(parent.twig)--
{% block outer %}
outer start
{% block inner %}
inner default
{% endblock %}
outer end
{% endblock %}
--DATA--
return []
--EXPECT--
outer wrap start
outer start
inner actual
outer end

outer wrap end
31 changes: 31 additions & 0 deletions tests/Fixtures/tags/inheritance/extends_with_nested_blocks.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
--TEST--
"extends" tag
--TEMPLATE--
{% extends "parent.twig" %}

{% block outer %}
outer wrap start
{{~ parent() }}
outer wrap end
{% endblock %}

{% block inner -%}
inner actual
{% endblock %}
--TEMPLATE(parent.twig)--
{% block outer %}
outer start
{% block inner %}
inner default
{% endblock %}
outer end
{% endblock %}
--DATA--
return []
--EXPECT--
outer wrap start
outer start
inner actual
outer end

outer wrap end

0 comments on commit 04f21b2

Please sign in to comment.