summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorSimon Wisselink <wisskid@users.noreply.github.com>2025-04-10 23:47:44 +0200
committerGitHub <noreply@github.com>2025-04-10 23:47:44 +0200
commita5bbba3f05b37b2c98c3d58fa151aa225131d8b7 (patch)
treecdcb440ffe319d2bbb2f3f4bdd4ff3f2d4028066 /tests
parenta0664a4ab2e64848684a0fe5f3ed5e71eb920020 (diff)
downloadsmarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.tar.gz
smarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.tar.bz2
smarty-a5bbba3f05b37b2c98c3d58fa151aa225131d8b7.zip
Fix syntax error occurring when registering a function plugin that ends with the string 'close' (#1124)
Fixes #1122
Diffstat (limited to 'tests')
-rw-r--r--tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php
index 81549525..7bfe1a59 100644
--- a/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php
+++ b/tests/UnitTests/SmartyMethodsTests/RegisterFunction/RegisterFunctionTest.php
@@ -192,6 +192,15 @@ class RegisterFunctionTest extends PHPUnit_Smarty
];
}
+ /**
+ * test registerPlugin for function name ending in 'close' #1122
+ */
+ public function testRegisterFunctionEndingInClose()
+ {
+ $this->smarty->registerPlugin(Smarty::PLUGIN_FUNCTION, 'window_close', 'myfunction');
+ $this->assertEquals('hello world 1', $this->smarty->fetch('eval:{window_close value=1}'));
+ }
+
}
function myfunction($params, $smarty)