Files
Twig/tests/Fixtures/functions/block_without_parent.test
2019-06-30 14:51:54 +02:00

12 lines
416 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 array()
--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.