Strengthen the default filter regression test

This commit is contained in:
Fabien Potencier
2026-09-03 08:32:22 +02:00
parent 86c830ef45
commit 0b4199c522
+5
View File
@@ -456,6 +456,11 @@ class ExpressionParserTest extends TestCase
['foo' => null],
'',
],
[
'{% for foo in foos %}[{{ foo?.bar|default(foo?.baz) }}]{% endfor %}',
['foos' => [(object) ['bar' => 'corge', 'baz' => 'grault'], (object) ['baz' => 'qux']]],
'[corge][qux]',
],
[
'{{ foo?.bar|default(foo?.baz) }}',
['foo' => (object) ['bar' => null, 'baz' => 'qux']],