diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index 579f4eb9..deba7e96 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -181,7 +181,7 @@ class CompileFunctionTest extends PHPUnit_Smarty } /** - * @runInSeparateProcess + * @run InSeparateProcess * @preserveGlobalState disabled * @dataProvider functionProviderInline * test function definition in include @@ -213,6 +213,20 @@ class CompileFunctionTest extends PHPUnit_Smarty $this->assertContains('foo foo', $this->smarty->fetch($tpl), $text); } + /** + * @run InSeparateProcess + * @preserveGlobalState disabled + * test external function definition and called by fetch + * + */ + public function testExternalDefinedFunctionCalledByFetch() + { + $this->smarty->assign('foo', 'foo'); + $this->assertContains('foo foo', $this->smarty->fetch('test_template_function.tpl')); + $this->smarty->assign('foo', 'bar'); + $this->assertContains('bar bar', $this->smarty->fetch('test_template_function_call.tpl')); + } + /** * @runInSeparateProcess * @preserveGlobalState disabled diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/test_template_function_call.tpl b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/test_template_function_call.tpl new file mode 100644 index 00000000..14829d91 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates/test_template_function_call.tpl @@ -0,0 +1 @@ +{call name=template_func1} \ No newline at end of file