From e2cb9873ff4eb0b39a05f2f6055775c843efa426 Mon Sep 17 00:00:00 2001 From: Simon Wisselink Date: Fri, 15 Mar 2024 16:18:19 +0100 Subject: [PATCH] New unit test for function scope --- tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php index 8c0a7156e..8febf2e0c 100644 --- a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php +++ b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php @@ -299,4 +299,12 @@ public function testFunctionScope() $this->smarty->assign('scope', 'none'); $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); + } + + }