skip closure on php 5.2

This commit is contained in:
uwetews
2015-12-31 05:20:00 +01:00
parent 1981dd8016
commit 9a61f1511c

View File

@@ -18,7 +18,7 @@ class FilterTest extends PHPUnit_Smarty
public $loadSmartyBC = true; public $loadSmartyBC = true;
public function setUp() public function setUp()
{ {
$this->setUpSmarty(__DIR__); $this->setUpSmarty(dirname(__FILE__));
} }
public function testInit() public function testInit()
@@ -101,6 +101,9 @@ class FilterTest extends PHPUnit_Smarty
*/ */
public function testRegisteredPreFilterClosure() public function testRegisteredPreFilterClosure()
{ {
if (version_compare(PHP_VERSION, '5.2', '<=')) {
$this->markTestSkipped('closure not available');
}
$this->smarty->registerFilter(Smarty::FILTER_PRE, function($input) {return '{$foo}' . $input;}); $this->smarty->registerFilter(Smarty::FILTER_PRE, function($input) {return '{$foo}' . $input;});
$tpl = $this->smarty->createTemplate('eval:{" hello world"}'); $tpl = $this->smarty->createTemplate('eval:{" hello world"}');
$tpl->assign('foo', 'buh'); $tpl->assign('foo', 'buh');