mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-15 20:06:31 +00:00
Failing test for fabpot/Twig#958
This test case reproduces the issue reported by @stof in fabfot/Twig#958. This problem is being caused by the fact that the {% embed %} tag causes the generation of a separate template class sharing the exact same $this->templateName value as the main template containing the tag. This then confuses Twig_Error::guessTemplateInfo when it's iterating through the $backtrace comparing $this->filename to $trace['object']->getTemplateName().
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
--TEST--
|
||||
"embed" tag
|
||||
--TEMPLATE(index.twig)--
|
||||
FOO
|
||||
{% embed "foo.twig" %}
|
||||
{% block c1 %}
|
||||
{{ nothing }}
|
||||
{% endblock %}
|
||||
{% endembed %}
|
||||
BAR
|
||||
--TEMPLATE(foo.twig)--
|
||||
{% block c1 %}{% endblock %}
|
||||
--DATA--
|
||||
return array()
|
||||
--EXCEPTION--
|
||||
Twig_Error_Runtime: Variable "nothing" does not exist in "index.twig" at line 5
|
||||
Reference in New Issue
Block a user