Test isset() 0n $smarty.foreache special variables

This commit is contained in:
uwetews
2016-09-20 14:17:17 +02:00
parent 75432afb05
commit 81852c085f
3 changed files with 12 additions and 0 deletions

View File

@@ -287,4 +287,14 @@ class CompileForeachTest extends PHPUnit_Smarty
$this->assertEquals("a1a2a1a2",
$this->smarty->fetch('035_foreach.tpl'));
}
public function testForeachIsset_36()
{
$this->assertEquals("false",
$this->smarty->fetch('036_foreach.tpl'));
}
public function testForeachIsset_37()
{
$this->assertEquals("false",
$this->smarty->fetch('037_foreach.tpl'));
}
}

View File

@@ -0,0 +1 @@
{if !isset($smarty.foreach.name.index)}false{/if}

View File

@@ -0,0 +1 @@
{if false}no{elseif !isset($smarty.foreach.name.index)}false{/if}