summaryrefslogtreecommitdiff
path: root/tests/UnitTests/TemplateSource/X_Scopes
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2024-03-15 16:10:27 +0100
committerGitHub <noreply@github.com>2024-03-15 16:10:27 +0100
commit82397ec7f074c56844d2e489ac1c40ca2ca3e756 (patch)
treece5ccb237c720650744997115e46643600f6205d /tests/UnitTests/TemplateSource/X_Scopes
parent17da1f585eb0d02c5b55d42d681ab4df77d7538e (diff)
downloadsmarty-82397ec7f074c56844d2e489ac1c40ca2ca3e756.tar.gz
smarty-82397ec7f074c56844d2e489ac1c40ca2ca3e756.tar.bz2
smarty-82397ec7f074c56844d2e489ac1c40ca2ca3e756.zip
Fixed that scoped variables would overwrite parent scope. (#954)
* Fixed that scoped variables would overwrite parent scope. Fixes #952 * Moved variable stack maintenance to methods and private properties in Data class.
Diffstat (limited to 'tests/UnitTests/TemplateSource/X_Scopes')
-rw-r--r--tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php
index 4f805fae..3999538e 100644
--- a/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php
+++ b/tests/UnitTests/TemplateSource/X_Scopes/ScopeTest.php
@@ -325,4 +325,13 @@ class ScopeTest extends PHPUnit_Smarty
$this->smarty->assign('scope', 'none');
$r = $this->smarty->fetch('test_function_scope.tpl');
}
+
+ public function testFunctionScopeIsLocalByDefault()
+ {
+ $this->assertEquals(
+ 'a',
+ $this->smarty->fetch('string:{function name=test}{$var="b"}{/function}{$var="a"}{test}{$var}')
+ );
+ }
+
}