Files
Twig/tests/Fixtures/functions/block_without_parent.test
2024-04-14 12:38:19 +02:00

12 lines
411 B
Plaintext

--TEST--
"block" calling parent() with no definition in parent template
--TEMPLATE--
{% extends "parent.twig" %}
{% block label %}{{ parent() }}{% endblock %}
--TEMPLATE(parent.twig)--
{{ block('label') }}
--DATA--
return []
--EXCEPTION--
Twig\Error\RuntimeError: Block "label" should not call parent() in "index.twig" as the block does not exist in the parent template "parent.twig" in "index.twig" at line 3.