Add closure test

This commit is contained in:
Uwe Tews
2015-06-19 03:00:20 +02:00
parent 9400c6307f
commit 441ac8e100

View File

@@ -94,6 +94,17 @@ class FilterTest extends PHPUnit_Smarty
$this->assertEquals("bar hello world", $this->smarty->fetch($tpl));
}
/**
* test registered pre filter closure
*/
public function testRegisteredPreFilterClosure()
{
$this->smarty->registerFilter(Smarty::FILTER_PRE, function($input) {return '{$foo}' . $input;});
$tpl = $this->smarty->createTemplate('eval:{" hello world"}');
$tpl->assign('foo', 'buh');
$this->assertEquals("buh hello world", $this->smarty->fetch($tpl));
}
/**
* test registered pre filter class
*/