diff --git a/CHANGELOG b/CHANGELOG index 9fd7bf1a1..c7248c3fb 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -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) diff --git a/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test b/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test new file mode 100644 index 000000000..2ab298059 --- /dev/null +++ b/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_extends.test @@ -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. diff --git a/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test b/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test new file mode 100644 index 000000000..e2281b290 --- /dev/null +++ b/test/Twig/Tests/Fixtures/exceptions/exception_in_extension_include.test @@ -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.