Test template function call in fetched template

This commit is contained in:
uwetews
2016-10-27 05:24:08 +02:00
parent bfb502b633
commit 8e42150426
2 changed files with 16 additions and 1 deletions

View File

@@ -181,7 +181,7 @@ class CompileFunctionTest extends PHPUnit_Smarty
} }
/** /**
* @runInSeparateProcess * @run InSeparateProcess
* @preserveGlobalState disabled * @preserveGlobalState disabled
* @dataProvider functionProviderInline * @dataProvider functionProviderInline
* test function definition in include * test function definition in include
@@ -213,6 +213,20 @@ class CompileFunctionTest extends PHPUnit_Smarty
$this->assertContains('foo foo', $this->smarty->fetch($tpl), $text); $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 * @runInSeparateProcess
* @preserveGlobalState disabled * @preserveGlobalState disabled

View File

@@ -0,0 +1 @@
{call name=template_func1}