Added test to see what changed exactly

This commit is contained in:
Simon Wisselink
2022-11-23 23:56:08 +01:00
parent 044647bd71
commit dee0c3ffd4

View File

@@ -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));
}
}