New unit test for function scope

This commit is contained in:
Simon Wisselink
2024-03-15 16:18:19 +01:00
parent f4152e9b81
commit e2cb9873ff

View File

@@ -299,4 +299,12 @@ class ScopeTest extends PHPUnit_Smarty
$this->smarty->assign('scope', 'none'); $this->smarty->assign('scope', 'none');
$r = $this->smarty->fetch('test_function_scope.tpl'); $r = $this->smarty->fetch('test_function_scope.tpl');
} }
public function testFunctionScopeIsLocalByDefault()
{
$r = $this->smarty->fetch('string:{function name=test}{$var="b"}{/function}{$var="a"}{test}{$var}');
$this->assertEquals('a', $r);
}
} }