From dee0c3ffd45feea80f95f2cca4c13cfc7d0e6b13 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Wed, 23 Nov 2022 23:56:08 +0100 Subject: [PATCH] Added test to see what changed exactly --- .../UndefinedTemplateVarTest.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php index 617adfdd..a727fb94 100644 --- a/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php +++ b/tests/UnitTests/A_2/UndefinedTemplateVar/UndefinedTemplateVarTest.php @@ -133,5 +133,19 @@ class UndefinedTemplateVarTest extends PHPUnit_Smarty $this->assertTrue($exceptionThrown); } + public function testUsingNullAsAnArray() { + $this->smarty->setErrorReporting(E_ALL & ~E_NOTICE); + $this->smarty->muteUndefinedOrNullWarnings(); + $tpl = $this->smarty->createTemplate('string:a{if $undef.k}def{/if}b'); + $this->assertEquals("ab", $this->smarty->fetch($tpl)); + } + + public function testUsingFalseAsAnArray() { + $this->smarty->setErrorReporting(E_ALL & ~E_NOTICE); + $this->smarty->muteUndefinedOrNullWarnings(); + $tpl = $this->smarty->createTemplate('string:a{if $nottrue.k}def{/if}b'); + $this->smarty->assign('nottrue', false); + $this->assertEquals("ab", $this->smarty->fetch($tpl)); + } }