mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 17:34:26 +02:00
Add test for getTemplateVars returning array of values
This commit is contained in:
@@ -109,4 +109,17 @@ class GetTemplateVarsTest extends PHPUnit_Smarty
|
||||
$this->assertEquals("bar2", $this->smarty->getTemplateVars('foo2', $data2, false));
|
||||
$this->assertEquals("", $this->smarty->getTemplateVars('blar', $data2, false));
|
||||
}
|
||||
|
||||
public function testSimpleCallReturnsArrayWithAllValues()
|
||||
{
|
||||
$this->smarty->assign('foo', 'bar');
|
||||
$this->smarty->assign('i', 3);
|
||||
|
||||
$vars = $this->smarty->getTemplateVars();
|
||||
|
||||
$this->assertArrayHasKey('foo', $vars);
|
||||
$this->assertArrayHasKey('i', $vars);
|
||||
$this->assertEquals('bar', $vars['foo']);
|
||||
$this->assertEquals(3,$vars['i']);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user