mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-12 18:36:53 +00:00
minor #4749 Fix null-safe operator test (HypeMC)
This PR was merged into the 3.x branch.
Discussion
----------
Fix null-safe operator test
Noticed this while working on #4748.
Without `strict_variables`, the tests always pass, even when the null-safe operator is not used.
Commits
-------
a16ac6bd35 Fix null-safe operator test
This commit is contained in:
@@ -302,7 +302,7 @@ class ExpressionParserTest extends TestCase
|
||||
*/
|
||||
public function testNullSafeOperator($template, $data, $expected)
|
||||
{
|
||||
$env = new Environment(new ArrayLoader(['template' => $template]));
|
||||
$env = new Environment(new ArrayLoader(['template' => $template]), ['strict_variables' => true]);
|
||||
|
||||
$this->assertSame($expected, $env->render('template', $data));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user