mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 18:36:53 +00:00
added more tests
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
* 1.39.0 (2019-XX-XX)
|
* 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
|
* made escaping on ternary expressions (?: and ??) more fine-grained
|
||||||
* added the possibility to give a nice name to string templates (template_from_string function)
|
* 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)
|
* 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.
|
||||||
Reference in New Issue
Block a user