added more tests

This commit is contained in:
Fabien Potencier
2019-04-12 10:30:51 +02:00
parent d4db91535d
commit 094df799be
3 changed files with 26 additions and 0 deletions
+2
View File
@@ -1,5 +1,7 @@
* 1.39.0 (2019-XX-XX)
* fixed some wrong location in error messages
* made exception creation faster
* made escaping on ternary expressions (?: and ??) more fine-grained
* added the possibility to give a nice name to string templates (template_from_string function)
* fixed the "with" behavior to always include the globals (for consistency with the "include" and "embed" tags)
@@ -0,0 +1,12 @@
--TEST--
Exception thrown from a child for an extension error
--TEMPLATE--
{% extends 'base.twig' %}
--TEMPLATE(base.twig)--
{{ random([]) }}
--DATA--
return []
--EXCEPTION--
Twig\Error\RuntimeError: The random function cannot pick from an empty array in "base.twig" at line 4.
@@ -0,0 +1,12 @@
--TEST--
Exception thrown from an include for an extension error
--TEMPLATE--
{% include 'content.twig' %}
--TEMPLATE(content.twig)--
{{ random([]) }}
--DATA--
return []
--EXCEPTION--
Twig\Error\RuntimeError: The random function cannot pick from an empty array in "content.twig" at line 4.