From e1a34fbc87c345c173cd22eea4befd2151999c3e Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 14 May 2015 15:03:55 +0200 Subject: [PATCH] added recursive template function tests --- .../TemplateFunction/CompileFunctionTest.php | 21 ++++ ...d71063d.test_template_function_003.tpl.php | 77 ++++++++++++ ...a168f74.test_template_function_002.tpl.php | 92 ++++++++++++++ ...a168f74.test_template_function_002.tpl.php | 102 ++++++++++++++++ ...est_template_function_nocache_call.tpl.php | 63 ++++++++++ ...5b832d9728a.test_template_function.tpl.php | 77 ++++++++++++ ...8e9f54a.test_template_function_001.tpl.php | 59 +++++++++ ...est_template_function_nocache_call.tpl.php | 63 ++++++++++ ...5b832d9728a.test_template_function.tpl.php | 77 ++++++++++++ ...e.test_template_function_003.tpl.cache.php | 98 +++++++++++++++ ...e.test_template_function_002.tpl.cache.php | 99 +++++++++++++++ ...1a_0.file.test_define_function_tag.tpl.php | 67 +++++++++++ ..._0.file.test_template_function_003.tpl.php | 98 +++++++++++++++ ...0.file.test_template_function_tag2.tpl.php | 69 +++++++++++ ...e.test_template_function_002.tpl.cache.php | 97 +++++++++++++++ ...0.file.test_template_function_tag5.tpl.php | 68 +++++++++++ ...1.file.test_template_function_tag5.tpl.php | 87 ++++++++++++++ ...0.file.test_template_function_tag6.tpl.php | 32 +++++ ...1.file.test_template_function_tag6.tpl.php | 104 ++++++++++++++++ ...mplate_function_nocache_call.tpl.cache.php | 32 +++++ ...mplate_function_nocache_call.tpl.cache.php | 113 ++++++++++++++++++ ....file.test_template_function.tpl.cache.php | 31 +++++ ....file.test_template_function.tpl.cache.php | 112 +++++++++++++++++ ..._0.file.test_inherit_function_tag6.tpl.php | 30 +++++ ...a_0.file.test_inherit_function_tag.tpl.php | 30 +++++ ...e.test_template_function_001.tpl.cache.php | 68 +++++++++++ ..._0.file.test_template_function_001.tpl.php | 68 +++++++++++ ...0.file.template_function_lib.tpl.cache.php | 95 +++++++++++++++ ...0.file.test_template_function_tag4.tpl.php | 67 +++++++++++ 29 files changed, 2096 insertions(+) create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d.test_template_function_003.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/d80ab133a083b4a7b15480731cf13d1c48e9f54a.test_template_function_001.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/2e9582e4d4f31291755140d7b123bc17fbaa811a_0.file.test_define_function_tag.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6cb7077cbab7f8057647b7b11f55f38f2da9dc36_0.file.test_template_function_tag2.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_0.file.test_template_function_tag5.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_1.file.test_template_function_tag5.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_0.file.test_template_function_tag6.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_1.file.test_template_function_tag6.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_0.file.test_template_function_nocache_call.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_0.file.test_template_function.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/c43995ee759c6c7f171e915aace16ee91ee059a9_0.file.test_inherit_function_tag6.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d0ce3d3da7d8c86b14875fc36c9fccde5dc190ba_0.file.test_inherit_function_tag.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php create mode 100644 tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c_0.file.test_template_function_tag4.tpl.php diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php index 7c66bd4f..7161f7e2 100644 --- a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/CompileFunctionTest.php @@ -272,6 +272,27 @@ class CompileFunctionTest extends PHPUnit_Smarty $this->assertContains('bar bar', $this->smarty->fetch($tpl), $text); } + /** + * test external function definition nocache call 3 + * + * @run InSeparateProcess + * @preserveGlobalState disabled + */ + public function testExternalDefinedFunctionRecursion() + { + $this->assertEquals('12345', $this->smarty->fetch('test_template_function_recursion2.tpl')); + } + /** + * test external function definition nocache call 3 + * + * @run InSeparateProcess + * @preserveGlobalState disabled + */ + public function testExternalDefinedFunctionRecursion2() + { + $this->assertEquals('12345', $this->smarty->fetch('test_template_function_recursion2.tpl')); + } + /** * Function data provider inline */ diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d.test_template_function_003.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d.test_template_function_003.tpl.php new file mode 100644 index 00000000..9f92ff48 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d.test_template_function_003.tpl.php @@ -0,0 +1,77 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '422f9371d4d2d9de15c6d6b506a1de7f4d71063d' => + array ( + 0 => './templates/test_template_function_003.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '12318554f33a0dd75e8_81553017', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php', + 'uid' => '422f9371d4d2d9de15c6d6b506a1de7f4d71063d', + 'call_name_caching' => 'smarty_template_function_functest_12318554f33a0dd75e8_81553017_nocache', + 'call_name' => 'smarty_template_function_functest_12318554f33a0dd75e8_81553017', + ), + ), + 'variables' => + array ( + 'default' => 1, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a0e467b9_89359945', + 'saved_tpl_vars' => + array ( + ), + 'cache_lifetime' => 3600, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a0e467b9_89359945')) { +function content_554f33a0e467b9_89359945 ($_smarty_tpl) { +?> +tpl_vars; +foreach (array ( + 'default' => 'default', +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +tpl_vars['default']->value;?> + 1),$_smarty_tpl);?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + 1),$_smarty_tpl); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_12318554f33a0dd75e8_81553017 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php new file mode 100644 index 00000000..8f066ada --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/1^6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php @@ -0,0 +1,92 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '6df2384df0a3755f460437207bf362b39a168f74' => + array ( + 0 => './templates/test_template_function_002.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '22688554f33a06da492_37365358', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php', + 'uid' => '6df2384df0a3755f460437207bf362b39a168f74', + 'call_name_caching' => 'smarty_template_function_functest_22688554f33a06da492_37365358_nocache', + 'call_name' => 'smarty_template_function_functest_22688554f33a06da492_37365358', + ), + ), + 'variables' => + array ( + 'default' => 1, + 'param' => 0, + ), + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a0754e03_36911292', + 'saved_tpl_vars' => + array ( + ), + 'cache_lifetime' => 3600, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a0754e03_36911292')) { +function content_554f33a0754e03_36911292 ($_smarty_tpl) { +?> +tpl_vars; +foreach (array ( + 'default' => 'default', + 'param' => 'param', +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +tpl_vars['default']->value;?> + tpl_vars['param']->value;?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> + tpl_vars; +foreach (array ( + 'default' => 'default', + 'param' => 1, +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +tpl_vars['default']->value;?> + tpl_vars['param']->value;?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value,'default'=>$_smarty_tpl->tpl_vars['default']->value), true);?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_22688554f33a06da492_37365358 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php new file mode 100644 index 00000000..9a49e9d6 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/6df2384df0a3755f460437207bf362b39a168f74.test_template_function_002.tpl.php @@ -0,0 +1,102 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '6df2384df0a3755f460437207bf362b39a168f74' => + array ( + 0 => './templates/test_template_function_002.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '32163554f33a03b9d17_30936283', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php', + 'uid' => '6df2384df0a3755f460437207bf362b39a168f74', + 'call_name_caching' => 'smarty_template_function_functest_32163554f33a03b9d17_30936283_nocache', + 'call_name' => 'smarty_template_function_functest_32163554f33a03b9d17_30936283', + ), + ), + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a04382f2_73659407', + 'saved_tpl_vars' => + array ( + ), + 'cache_lifetime' => 3600, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a04382f2_73659407')) { +function content_554f33a04382f2_73659407 ($_smarty_tpl) { +?> +tpl_vars; +foreach (array ( + 'default' => 'default', + 'param' => 'param', +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +default tpl_vars['param']->value;?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> + tpl_vars; +foreach (array ( + 'default' => 'default', + 'param' => 1, +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +default tpl_vars['param']->value;?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> + tpl_vars; +foreach (array ( + 'default' => 2, + 'param' => 1, +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +2 tpl_vars['param']->value;?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_32163554f33a03b9d17_30936283 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php new file mode 100644 index 00000000..038eda53 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php @@ -0,0 +1,63 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61' => + array ( + 0 => './templates/test_template_function_nocache_call.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '9227554f33a309a449_19754931', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841_nocache', + 'call_name' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841', + ), + ), + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a30ebdc0_07849220', + 'cache_lifetime' => 1000, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a30ebdc0_07849220')) { +function content_554f33a30ebdc0_07849220 ($_smarty_tpl) { +?> + +callTemplateFunction ('template_func1', $_smarty_tpl, array(), true);?> +tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_30703554f33a2534bd6_18319841 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php new file mode 100644 index 00000000..d4714a6c --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php @@ -0,0 +1,77 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '9d9c162f1a2d1af75355a54fa37e85b832d9728a' => + array ( + 0 => './templates/test_template_function.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '23758554f33a24e2527_45120061', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841_nocache', + 'call_name' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841', + ), + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a259ff47_11133331', + 'saved_tpl_vars' => + array ( + ), + 'cache_lifetime' => 1000, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a259ff47_11133331')) { +function content_554f33a259ff47_11133331 ($_smarty_tpl) { +?> + +tpl_vars; +foreach (array ( + 'default' => 'd1', +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +foo tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> +tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_30703554f33a2534bd6_18319841 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/d80ab133a083b4a7b15480731cf13d1c48e9f54a.test_template_function_001.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/d80ab133a083b4a7b15480731cf13d1c48e9f54a.test_template_function_001.tpl.php new file mode 100644 index 00000000..0d9ec38d --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/d80ab133a083b4a7b15480731cf13d1c48e9f54a.test_template_function_001.tpl.php @@ -0,0 +1,59 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + 'd80ab133a083b4a7b15480731cf13d1c48e9f54a' => + array ( + 0 => './templates/test_template_function_001.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '22738554f33a00aae61_12933950', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php', + 'uid' => 'd80ab133a083b4a7b15480731cf13d1c48e9f54a', + 'call_name' => 'smarty_template_function_functest_22738554f33a00aae61_12933950', + ), + ), + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a01276d2_11243022', + 'cache_lifetime' => 3600, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a01276d2_11243022')) { +function content_554f33a01276d2_11243022 ($_smarty_tpl) { +?> +default param default 1 2 1tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_22738554f33a00aae61_12933950 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php new file mode 100644 index 00000000..a3f68e03 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61.test_template_function_nocache_call.tpl.php @@ -0,0 +1,63 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61' => + array ( + 0 => './templates/test_template_function_nocache_call.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '25320554f33a336e935_85019970', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_14246554f33a33751a3_10584105_nocache', + 'call_name' => 'smarty_template_function_template_func1_14246554f33a33751a3_10584105', + ), + ), + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a33f3c65_91556820', + 'cache_lifetime' => 1000, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a33f3c65_91556820')) { +function content_554f33a33f3c65_91556820 ($_smarty_tpl) { +?> + +callTemplateFunction ('template_func1', $_smarty_tpl, array(), true);?> +tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_14246554f33a33751a3_10584105 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php new file mode 100644 index 00000000..bbe7c23e --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/cache/merge^9d9c162f1a2d1af75355a54fa37e85b832d9728a.test_template_function.tpl.php @@ -0,0 +1,77 @@ +decodeProperties(array ( + 'file_dependency' => + array ( + '9d9c162f1a2d1af75355a54fa37e85b832d9728a' => + array ( + 0 => './templates/test_template_function.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '4860554f33a2834c32_19980616', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_30682554f33a283b093_35547451_nocache', + 'call_name' => 'smarty_template_function_template_func1_30682554f33a283b093_35547451', + ), + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a28b0fa7_27887260', + 'saved_tpl_vars' => + array ( + ), + 'cache_lifetime' => 1000, +),true); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a28b0fa7_27887260')) { +function content_554f33a28b0fa7_27887260 ($_smarty_tpl) { +?> + +tpl_vars; +foreach (array ( + 'default' => 'd1', +) as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +?> +foo tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars;?> +tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_30682554f33a283b093_35547451 */?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php new file mode 100644 index 00000000..efb48f9b --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php @@ -0,0 +1,98 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '422f9371d4d2d9de15c6d6b506a1de7f4d71063d' => + array ( + 0 => './templates/test_template_function_003.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '12318554f33a0dd75e8_81553017', + 'variables' => + array ( + 'default' => 1, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a0df8d73_61285923', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/1^422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.cache.php', + 'uid' => '422f9371d4d2d9de15c6d6b506a1de7f4d71063d', + 'call_name_caching' => 'smarty_template_function_functest_12318554f33a0dd75e8_81553017_nocache', + 'call_name' => 'smarty_template_function_functest_12318554f33a0dd75e8_81553017', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a0df8d73_61285923')) { +function content_554f33a0df8d73_61285923 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '12318554f33a0dd75e8_81553017'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array(), false);?> +/*/%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/'; +ob_start(); +$params = array_merge(array('default'=>'default'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/ +"; +echo '/*%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/tpl_vars[\'default\']->value;?> +/*/%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/';?> + 1),$_smarty_tpl);?> +/*/%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/'; +echo "/*%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/ \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:12318554f33a0dd75e8_81553017%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_functest_12318554f33a0dd75e8_81553017_nocache */ +/* smarty_template_function_functest_12318554f33a0dd75e8_81553017 */ +if (!function_exists('smarty_template_function_functest_12318554f33a0dd75e8_81553017')) { +function smarty_template_function_functest_12318554f33a0dd75e8_81553017($_smarty_tpl,$params) { +if (!is_callable('smarty_function_counter')) require_once 'C:/wamp/www/Smarty3.1-test-release/vendor/smarty/smarty/libs/plugins/function.counter.php'; +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + 1),$_smarty_tpl); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_12318554f33a0dd75e8_81553017 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php new file mode 100644 index 00000000..59824358 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php @@ -0,0 +1,99 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '6df2384df0a3755f460437207bf362b39a168f74' => + array ( + 0 => './templates/test_template_function_002.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '22688554f33a06da492_37365358', + 'variables' => + array ( + 'default' => 1, + 'param' => 0, + ), + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a0711af3_13839557', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/1^6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php', + 'uid' => '6df2384df0a3755f460437207bf362b39a168f74', + 'call_name_caching' => 'smarty_template_function_functest_22688554f33a06da492_37365358_nocache', + 'call_name' => 'smarty_template_function_functest_22688554f33a06da492_37365358', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a0711af3_13839557')) { +function content_554f33a0711af3_13839557 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '22688554f33a06da492_37365358'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array('param'=>'param'), false);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value), false);?> + callTemplateFunction (\'functest\', $_smarty_tpl, array(\'param\'=>$_smarty_tpl->tpl_vars[\'param\']->value,\'default\'=>$_smarty_tpl->tpl_vars[\'default\']->value), true);?> +/*/%%SmartyNocache:22688554f33a06da492_37365358%%*/';?> +'default'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:22688554f33a06da492_37365358%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:22688554f33a06da492_37365358%%*/ +"; +echo '/*%%SmartyNocache:22688554f33a06da492_37365358%%*/tpl_vars[\'default\']->value;?> +/*/%%SmartyNocache:22688554f33a06da492_37365358%%*/';?> + tpl_vars[\'param\']->value;?> +/*/%%SmartyNocache:22688554f33a06da492_37365358%%*/'; +echo "/*%%SmartyNocache:22688554f33a06da492_37365358%%*/ \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:22688554f33a06da492_37365358%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_functest_22688554f33a06da492_37365358_nocache */ +/* smarty_template_function_functest_22688554f33a06da492_37365358 */ +if (!function_exists('smarty_template_function_functest_22688554f33a06da492_37365358')) { +function smarty_template_function_functest_22688554f33a06da492_37365358($_smarty_tpl,$params) { +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_22688554f33a06da492_37365358 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/2e9582e4d4f31291755140d7b123bc17fbaa811a_0.file.test_define_function_tag.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/2e9582e4d4f31291755140d7b123bc17fbaa811a_0.file.test_define_function_tag.tpl.php new file mode 100644 index 00000000..4269c097 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/2e9582e4d4f31291755140d7b123bc17fbaa811a_0.file.test_define_function_tag.tpl.php @@ -0,0 +1,67 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '2e9582e4d4f31291755140d7b123bc17fbaa811a' => + array ( + 0 => './templates/test_define_function_tag.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '24823554f33a1d764f9_03909341', + 'variables' => + array ( + 'loop' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a1d9b877_15698903', + 'tpl_function' => + array ( + 'functest6i' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/2e9582e4d4f31291755140d7b123bc17fbaa811a_0.file.test_define_function_tag.tpl.php', + 'uid' => '2e9582e4d4f31291755140d7b123bc17fbaa811a', + 'call_name' => 'smarty_template_function_functest6i_24823554f33a1d764f9_03909341', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a1d9b877_15698903')) { +function content_554f33a1d9b877_15698903 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '24823554f33a1d764f9_03909341'; +?> +tpl_vars; +$params = array_merge(array('loop'=>0), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['loop']->value; +if ($_smarty_tpl->tpl_vars['loop']->value<5) { +$_smarty_tpl->callTemplateFunction ('functest6i', $_smarty_tpl, array('loop'=>$_smarty_tpl->tpl_vars['loop']->value+1), false); +} +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest6i_24823554f33a1d764f9_03909341 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.php new file mode 100644 index 00000000..e01136f8 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.php @@ -0,0 +1,98 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '422f9371d4d2d9de15c6d6b506a1de7f4d71063d' => + array ( + 0 => './templates/test_template_function_003.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '11353554f33a0b12c39_38927265', + 'variables' => + array ( + 'default' => 1, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a0b34e64_35437774', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/422f9371d4d2d9de15c6d6b506a1de7f4d71063d_0.file.test_template_function_003.tpl.php', + 'uid' => '422f9371d4d2d9de15c6d6b506a1de7f4d71063d', + 'call_name_caching' => 'smarty_template_function_functest_11353554f33a0b12c39_38927265_nocache', + 'call_name' => 'smarty_template_function_functest_11353554f33a0b12c39_38927265', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a0b34e64_35437774')) { +function content_554f33a0b34e64_35437774 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '11353554f33a0b12c39_38927265'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array(), true);?> +/*/%%SmartyNocache:11353554f33a0b12c39_38927265%%*/'; +ob_start(); +$params = array_merge(array('default'=>'default'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:11353554f33a0b12c39_38927265%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:11353554f33a0b12c39_38927265%%*/ +"; +echo '/*%%SmartyNocache:11353554f33a0b12c39_38927265%%*/tpl_vars[\'default\']->value;?> +/*/%%SmartyNocache:11353554f33a0b12c39_38927265%%*/';?> + 1),$_smarty_tpl);?> +/*/%%SmartyNocache:11353554f33a0b12c39_38927265%%*/'; +echo "/*%%SmartyNocache:11353554f33a0b12c39_38927265%%*/ \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:11353554f33a0b12c39_38927265%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_functest_11353554f33a0b12c39_38927265_nocache */ +/* smarty_template_function_functest_11353554f33a0b12c39_38927265 */ +if (!function_exists('smarty_template_function_functest_11353554f33a0b12c39_38927265')) { +function smarty_template_function_functest_11353554f33a0b12c39_38927265($_smarty_tpl,$params) { +if (!is_callable('smarty_function_counter')) require_once 'C:/wamp/www/Smarty3.1-test-release/vendor/smarty/smarty/libs/plugins/function.counter.php'; +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + 1),$_smarty_tpl); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_11353554f33a0b12c39_38927265 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6cb7077cbab7f8057647b7b11f55f38f2da9dc36_0.file.test_template_function_tag2.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6cb7077cbab7f8057647b7b11f55f38f2da9dc36_0.file.test_template_function_tag2.tpl.php new file mode 100644 index 00000000..a8baf665 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6cb7077cbab7f8057647b7b11f55f38f2da9dc36_0.file.test_template_function_tag2.tpl.php @@ -0,0 +1,69 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '6cb7077cbab7f8057647b7b11f55f38f2da9dc36' => + array ( + 0 => './templates/test_template_function_tag2.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '20735554f33a1198368_16340485', + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a11cbff7_75513815', + 'tpl_function' => + array ( + 'functest2' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/6cb7077cbab7f8057647b7b11f55f38f2da9dc36_0.file.test_template_function_tag2.tpl.php', + 'uid' => '6cb7077cbab7f8057647b7b11f55f38f2da9dc36', + 'call_name' => 'smarty_template_function_functest2_20735554f33a1198368_16340485', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a11cbff7_75513815')) { +function content_554f33a11cbff7_75513815 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '20735554f33a1198368_16340485'; +$_smarty_tpl->callTemplateFunction ('functest2', $_smarty_tpl, array('param'=>'param'), true);?> + callTemplateFunction ('functest2', $_smarty_tpl, array('param'=>'param2'), true);?> + callTemplateFunction ('functest2', $_smarty_tpl, array('param'=>'param2','default'=>'passed'), true);?> + callTemplateFunction ('functest2', $_smarty_tpl, array('param'=>'param'), true);?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest2_20735554f33a1198368_16340485 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php new file mode 100644 index 00000000..57a61c68 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php @@ -0,0 +1,97 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '6df2384df0a3755f460437207bf362b39a168f74' => + array ( + 0 => './templates/test_template_function_002.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '32163554f33a03b9d17_30936283', + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a03f2984_15922471', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/6df2384df0a3755f460437207bf362b39a168f74_0.file.test_template_function_002.tpl.cache.php', + 'uid' => '6df2384df0a3755f460437207bf362b39a168f74', + 'call_name_caching' => 'smarty_template_function_functest_32163554f33a03b9d17_30936283_nocache', + 'call_name' => 'smarty_template_function_functest_32163554f33a03b9d17_30936283', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a03f2984_15922471')) { +function content_554f33a03f2984_15922471 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '32163554f33a03b9d17_30936283'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array('param'=>'param'), false);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value), false);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value,'default'=>$_smarty_tpl->tpl_vars['default']->value), false);?> +'default'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:32163554f33a03b9d17_30936283%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:32163554f33a03b9d17_30936283%%*/ +"; +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars[\'param\']->value;?> +/*/%%SmartyNocache:32163554f33a03b9d17_30936283%%*/'; +echo "/*%%SmartyNocache:32163554f33a03b9d17_30936283%%*/ \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:32163554f33a03b9d17_30936283%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_functest_32163554f33a03b9d17_30936283_nocache */ +/* smarty_template_function_functest_32163554f33a03b9d17_30936283 */ +if (!function_exists('smarty_template_function_functest_32163554f33a03b9d17_30936283')) { +function smarty_template_function_functest_32163554f33a03b9d17_30936283($_smarty_tpl,$params) { +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_32163554f33a03b9d17_30936283 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_0.file.test_template_function_tag5.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_0.file.test_template_function_tag5.tpl.php new file mode 100644 index 00000000..11e2234e --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_0.file.test_template_function_tag5.tpl.php @@ -0,0 +1,68 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '743d0e59177f943e67ac0f2a52c3e77d787a7b98' => + array ( + 0 => './templates/test_template_function_tag5.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '13589554f33a1739657_70054575', + 'variables' => + array ( + 'loop' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a17645a9_04761730', + 'tpl_function' => + array ( + 'functest4' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_0.file.test_template_function_tag5.tpl.php', + 'uid' => '743d0e59177f943e67ac0f2a52c3e77d787a7b98', + 'call_name' => 'smarty_template_function_functest4_13589554f33a1739657_70054575', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a17645a9_04761730')) { +function content_554f33a17645a9_04761730 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '13589554f33a1739657_70054575'; +echo $_smarty_tpl->getSubTemplate ('test_inherit_function_tag.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0); +?> +tpl_vars; +$params = array_merge(array('loop'=>0), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['loop']->value; +if ($_smarty_tpl->tpl_vars['loop']->value<5) { +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array('loop'=>$_smarty_tpl->tpl_vars['loop']->value+1), false); +} +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest4_13589554f33a1739657_70054575 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_1.file.test_template_function_tag5.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_1.file.test_template_function_tag5.tpl.php new file mode 100644 index 00000000..094b4fbf --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_1.file.test_template_function_tag5.tpl.php @@ -0,0 +1,87 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '743d0e59177f943e67ac0f2a52c3e77d787a7b98' => + array ( + 0 => './templates/test_template_function_tag5.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'd0ce3d3da7d8c86b14875fc36c9fccde5dc190ba' => + array ( + 0 => './templates/test_inherit_function_tag.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '32283554f33a1a4e286_12401978', + 'variables' => + array ( + 'loop' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a1a80068_05590904', + 'tpl_function' => + array ( + 'functest4' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/743d0e59177f943e67ac0f2a52c3e77d787a7b98_1.file.test_template_function_tag5.tpl.php', + 'uid' => '743d0e59177f943e67ac0f2a52c3e77d787a7b98', + 'call_name' => 'smarty_template_function_functest4_32283554f33a1a4e286_12401978', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a1a80068_05590904')) { +function content_554f33a1a80068_05590904 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '32283554f33a1a4e286_12401978'; +/* Call merged included template "test_inherit_function_tag.tpl" */ +echo $_smarty_tpl->getInlineSubTemplate('test_inherit_function_tag.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, '3473554f33a1a78440_81337556', 'content_554f33a1a77345_73752731'); +/* End of included template "test_inherit_function_tag.tpl" */?> + +properties['nocache_hash'] = '3473554f33a1a78440_81337556'; +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array(), true);?> +tpl_vars; +$params = array_merge(array('loop'=>0), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['loop']->value; +if ($_smarty_tpl->tpl_vars['loop']->value<5) { +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array('loop'=>$_smarty_tpl->tpl_vars['loop']->value+1), false); +} +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest4_32283554f33a1a4e286_12401978 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_0.file.test_template_function_tag6.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_0.file.test_template_function_tag6.tpl.php new file mode 100644 index 00000000..997619a8 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_0.file.test_template_function_tag6.tpl.php @@ -0,0 +1,32 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '7ab850c40341ef728a2c3a36cf62b7880b023d06' => + array ( + 0 => './templates/test_template_function_tag6.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '9462554f33a1d2ad82_45742097', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a1d35a35_68706146', +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a1d35a35_68706146')) { +function content_554f33a1d35a35_68706146 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '9462554f33a1d2ad82_45742097'; +echo $_smarty_tpl->getSubTemplate ('test_define_function_tag.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0); +echo $_smarty_tpl->getSubTemplate ('test_inherit_function_tag6.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0); +?> + \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_1.file.test_template_function_tag6.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_1.file.test_template_function_tag6.tpl.php new file mode 100644 index 00000000..d0fe72b5 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_1.file.test_template_function_tag6.tpl.php @@ -0,0 +1,104 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '7ab850c40341ef728a2c3a36cf62b7880b023d06' => + array ( + 0 => './templates/test_template_function_tag6.tpl', + 1 => 1430802407, + 2 => 'file', + ), + '2e9582e4d4f31291755140d7b123bc17fbaa811a' => + array ( + 0 => './templates/test_define_function_tag.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'c43995ee759c6c7f171e915aace16ee91ee059a9' => + array ( + 0 => './templates/test_inherit_function_tag6.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '29133554f33a2200012_48386613', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a223ad46_61545179', + 'tpl_function' => + array ( + 'functest6i' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/7ab850c40341ef728a2c3a36cf62b7880b023d06_1.file.test_template_function_tag6.tpl.php', + 'uid' => '2e9582e4d4f31291755140d7b123bc17fbaa811a', + 'call_name' => 'smarty_template_function_functest6i_5523554f33a22066a1_70467432', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a223ad46_61545179')) { +function content_554f33a223ad46_61545179 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '29133554f33a2200012_48386613'; +/* Call merged included template "test_define_function_tag.tpl" */ +echo $_smarty_tpl->getInlineSubTemplate('test_define_function_tag.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, '5523554f33a22066a1_70467432', 'content_554f33a2205710_05709812'); +/* End of included template "test_define_function_tag.tpl" */ +/* Call merged included template "test_inherit_function_tag6.tpl" */ +echo $_smarty_tpl->getInlineSubTemplate('test_inherit_function_tag6.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, '24009554f33a2232320_32744838', 'content_554f33a2231111_07613734'); +/* End of included template "test_inherit_function_tag6.tpl" */?> + +properties['nocache_hash'] = '5523554f33a22066a1_70467432'; +?> + +properties['nocache_hash'] = '24009554f33a2232320_32744838'; +$_smarty_tpl->callTemplateFunction ('functest6i', $_smarty_tpl, array(), true);?> +tpl_vars; +$params = array_merge(array('loop'=>0), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['loop']->value; +if ($_smarty_tpl->tpl_vars['loop']->value<5) { +$_smarty_tpl->callTemplateFunction ('functest6i', $_smarty_tpl, array('loop'=>$_smarty_tpl->tpl_vars['loop']->value+1), false); +} +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest6i_5523554f33a22066a1_70467432 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_0.file.test_template_function_nocache_call.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_0.file.test_template_function_nocache_call.tpl.cache.php new file mode 100644 index 00000000..6ecf5b1d --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_0.file.test_template_function_nocache_call.tpl.cache.php @@ -0,0 +1,32 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61' => + array ( + 0 => './templates/test_template_function_nocache_call.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '9227554f33a309a449_19754931', + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a30a7084_73390220', +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a30a7084_73390220')) { +function content_554f33a30a7084_73390220 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '9227554f33a309a449_19754931'; +echo $_smarty_tpl->getSubTemplate ('template_function_lib.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0); +echo '/*%%SmartyNocache:9227554f33a309a449_19754931%%*/callTemplateFunction (\'template_func1\', $_smarty_tpl, array(), true);?> +/*/%%SmartyNocache:9227554f33a309a449_19754931%%*/';?> + \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php new file mode 100644 index 00000000..61e15921 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php @@ -0,0 +1,113 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61' => + array ( + 0 => './templates/test_template_function_nocache_call.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '25320554f33a336e935_85019970', + 'has_nocache_code' => true, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a33a5381_95773343', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/7fe6a2a43aee3e8dbfe08235cf00ef0c2bdd4a61_1.file.test_template_function_nocache_call.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_14246554f33a33751a3_10584105_nocache', + 'call_name' => 'smarty_template_function_template_func1_14246554f33a33751a3_10584105', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a33a5381_95773343')) { +function content_554f33a33a5381_95773343 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '25320554f33a336e935_85019970'; +/* Call merged included template "template_function_lib.tpl" */ +echo $_smarty_tpl->getInlineSubTemplate('template_function_lib.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0, '14246554f33a33751a3_10584105', 'content_554f33a3374104_61765255'); +/* End of included template "template_function_lib.tpl" */ +echo '/*%%SmartyNocache:25320554f33a336e935_85019970%%*/callTemplateFunction (\'template_func1\', $_smarty_tpl, array(), true);?> +/*/%%SmartyNocache:25320554f33a336e935_85019970%%*/';?> + +properties['nocache_hash'] = '14246554f33a33751a3_10584105'; +?> + +'d1'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:14246554f33a33751a3_10584105%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:14246554f33a33751a3_10584105%%*/ +"; +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars[\'foo\']->value, ENT_QUOTES, \'UTF-8\', true);?> +/*/%%SmartyNocache:14246554f33a33751a3_10584105%%*/';?> + \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:14246554f33a33751a3_10584105%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_template_func1_14246554f33a33751a3_10584105_nocache */ +/* smarty_template_function_template_func1_14246554f33a33751a3_10584105 */ +if (!function_exists('smarty_template_function_template_func1_14246554f33a33751a3_10584105')) { +function smarty_template_function_template_func1_14246554f33a33751a3_10584105($_smarty_tpl,$params) { +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_14246554f33a33751a3_10584105 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_0.file.test_template_function.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_0.file.test_template_function.tpl.cache.php new file mode 100644 index 00000000..4708cfab --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_0.file.test_template_function.tpl.cache.php @@ -0,0 +1,31 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '9d9c162f1a2d1af75355a54fa37e85b832d9728a' => + array ( + 0 => './templates/test_template_function.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '23758554f33a24e2527_45120061', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a24ed0e0_77310981', +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a24ed0e0_77310981')) { +function content_554f33a24ed0e0_77310981 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '23758554f33a24e2527_45120061'; +echo $_smarty_tpl->getSubTemplate ('template_function_lib.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0); +$_smarty_tpl->callTemplateFunction ('template_func1', $_smarty_tpl, array(), false);?> + \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php new file mode 100644 index 00000000..6567126e --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php @@ -0,0 +1,112 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + '9d9c162f1a2d1af75355a54fa37e85b832d9728a' => + array ( + 0 => './templates/test_template_function.tpl', + 1 => 1430802407, + 2 => 'file', + ), + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '4860554f33a2834c32_19980616', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a28651d5_62401584', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/9d9c162f1a2d1af75355a54fa37e85b832d9728a_1.file.test_template_function.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_30682554f33a283b093_35547451_nocache', + 'call_name' => 'smarty_template_function_template_func1_30682554f33a283b093_35547451', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a28651d5_62401584')) { +function content_554f33a28651d5_62401584 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '4860554f33a2834c32_19980616'; +/* Call merged included template "template_function_lib.tpl" */ +echo $_smarty_tpl->getInlineSubTemplate('template_function_lib.tpl', $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 9999, $_smarty_tpl->cache_lifetime, array(), 0, '30682554f33a283b093_35547451', 'content_554f33a283a179_89560857'); +/* End of included template "template_function_lib.tpl" */ +$_smarty_tpl->callTemplateFunction ('template_func1', $_smarty_tpl, array(), false);?> + +properties['nocache_hash'] = '30682554f33a283b093_35547451'; +?> + +'d1'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:30682554f33a283b093_35547451%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:30682554f33a283b093_35547451%%*/ +"; +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars[\'foo\']->value, ENT_QUOTES, \'UTF-8\', true);?> +/*/%%SmartyNocache:30682554f33a283b093_35547451%%*/';?> + \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:30682554f33a283b093_35547451%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_template_func1_30682554f33a283b093_35547451_nocache */ +/* smarty_template_function_template_func1_30682554f33a283b093_35547451 */ +if (!function_exists('smarty_template_function_template_func1_30682554f33a283b093_35547451')) { +function smarty_template_function_template_func1_30682554f33a283b093_35547451($_smarty_tpl,$params) { +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_30682554f33a283b093_35547451 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/c43995ee759c6c7f171e915aace16ee91ee059a9_0.file.test_inherit_function_tag6.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/c43995ee759c6c7f171e915aace16ee91ee059a9_0.file.test_inherit_function_tag6.tpl.php new file mode 100644 index 00000000..d6c8d8a3 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/c43995ee759c6c7f171e915aace16ee91ee059a9_0.file.test_inherit_function_tag6.tpl.php @@ -0,0 +1,30 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'c43995ee759c6c7f171e915aace16ee91ee059a9' => + array ( + 0 => './templates/test_inherit_function_tag6.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '15204554f33a1de0580_19542266', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a1de7249_10070278', +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a1de7249_10070278')) { +function content_554f33a1de7249_10070278 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '15204554f33a1de0580_19542266'; +$_smarty_tpl->callTemplateFunction ('functest6i', $_smarty_tpl, array(), true);?> + \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d0ce3d3da7d8c86b14875fc36c9fccde5dc190ba_0.file.test_inherit_function_tag.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d0ce3d3da7d8c86b14875fc36c9fccde5dc190ba_0.file.test_inherit_function_tag.tpl.php new file mode 100644 index 00000000..6beb3378 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d0ce3d3da7d8c86b14875fc36c9fccde5dc190ba_0.file.test_inherit_function_tag.tpl.php @@ -0,0 +1,30 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'd0ce3d3da7d8c86b14875fc36c9fccde5dc190ba' => + array ( + 0 => './templates/test_inherit_function_tag.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '12330554f33a17a8e57_80091046', + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a17b2c42_44491970', +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a17b2c42_44491970')) { +function content_554f33a17b2c42_44491970 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '12330554f33a17a8e57_80091046'; +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array(), true);?> + \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php new file mode 100644 index 00000000..af97c2e3 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php @@ -0,0 +1,68 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'd80ab133a083b4a7b15480731cf13d1c48e9f54a' => + array ( + 0 => './templates/test_template_function_001.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '22738554f33a00aae61_12933950', + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a00dc9b8_87833168', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.cache.php', + 'uid' => 'd80ab133a083b4a7b15480731cf13d1c48e9f54a', + 'call_name' => 'smarty_template_function_functest_22738554f33a00aae61_12933950', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a00dc9b8_87833168')) { +function content_554f33a00dc9b8_87833168 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '22738554f33a00aae61_12933950'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array('param'=>'param'), false);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value), false);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value,'default'=>$_smarty_tpl->tpl_vars['default']->value), false);?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_22738554f33a00aae61_12933950 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.php new file mode 100644 index 00000000..a7724ed5 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.php @@ -0,0 +1,68 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'd80ab133a083b4a7b15480731cf13d1c48e9f54a' => + array ( + 0 => './templates/test_template_function_001.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '30557554f339fd13129_70091209', + 'variables' => + array ( + 'default' => 0, + 'param' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f339fd4d089_46348959', + 'tpl_function' => + array ( + 'functest' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/d80ab133a083b4a7b15480731cf13d1c48e9f54a_0.file.test_template_function_001.tpl.php', + 'uid' => 'd80ab133a083b4a7b15480731cf13d1c48e9f54a', + 'call_name' => 'smarty_template_function_functest_30557554f339fd13129_70091209', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f339fd4d089_46348959')) { +function content_554f339fd4d089_46348959 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '30557554f339fd13129_70091209'; +$_smarty_tpl->callTemplateFunction ('functest', $_smarty_tpl, array('param'=>'param'), true);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value), true);?> + callTemplateFunction ('functest', $_smarty_tpl, array('param'=>$_smarty_tpl->tpl_vars['param']->value,'default'=>$_smarty_tpl->tpl_vars['default']->value), true);?> +tpl_vars; +$params = array_merge(array('default'=>'default'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['default']->value;?> + tpl_vars['param']->value; +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest_30557554f339fd13129_70091209 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php new file mode 100644 index 00000000..0c585700 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php @@ -0,0 +1,95 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18' => + array ( + 0 => './templates/template_function_lib.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '30703554f33a2534bd6_18319841', + 'variables' => + array ( + 'foo' => 1, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a255bc18_48320158', + 'tpl_function' => + array ( + 'template_func1' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/dfb143ec1fbcb556e13ac1f174c3b8394191bd18_0.file.template_function_lib.tpl.cache.php', + 'uid' => 'dfb143ec1fbcb556e13ac1f174c3b8394191bd18', + 'call_name_caching' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841_nocache', + 'call_name' => 'smarty_template_function_template_func1_30703554f33a2534bd6_18319841', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a255bc18_48320158')) { +function content_554f33a255bc18_48320158 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '30703554f33a2534bd6_18319841'; +?> + +'d1'), $params); +$_smarty_tpl->properties['saved_tpl_vars'][] = $_smarty_tpl->tpl_vars; +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +}$params = var_export($params, true); +echo "/*%%SmartyNocache:30703554f33a2534bd6_18319841%%*/tpl_vars; +foreach ($params as \$key => \$value) { +\$_smarty_tpl->tpl_vars[\$key] = new Smarty_Variable(\$value); +} +?>/*/%%SmartyNocache:30703554f33a2534bd6_18319841%%*/ +"; +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars[\'foo\']->value, ENT_QUOTES, \'UTF-8\', true);?> +/*/%%SmartyNocache:30703554f33a2534bd6_18319841%%*/';?> + \$value){ +if (\$_smarty_tpl->tpl_vars[\$key] === \$value) \$saved_tpl_vars[\$key] = \$value; +} +\$_smarty_tpl->tpl_vars = \$saved_tpl_vars;?> +/*/%%SmartyNocache:30703554f33a2534bd6_18319841%%*/"; +?>properties['nocache_hash'], ob_get_clean()); +$_smarty_tpl->tpl_vars = array_pop($_smarty_tpl->properties['saved_tpl_vars']); +} +} +/*/ smarty_template_function_template_func1_30703554f33a2534bd6_18319841_nocache */ +/* smarty_template_function_template_func1_30703554f33a2534bd6_18319841 */ +if (!function_exists('smarty_template_function_template_func1_30703554f33a2534bd6_18319841')) { +function smarty_template_function_template_func1_30703554f33a2534bd6_18319841($_smarty_tpl,$params) { +$saved_tpl_vars = $_smarty_tpl->tpl_vars; +$params = array_merge(array('default'=>'d1'), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo htmlspecialchars($_smarty_tpl->tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true);?> + tpl_vars['foo']->value, ENT_QUOTES, 'UTF-8', true); +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_template_func1_30703554f33a2534bd6_18319841 */ + +?> diff --git a/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c_0.file.test_template_function_tag4.tpl.php b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c_0.file.test_template_function_tag4.tpl.php new file mode 100644 index 00000000..0de9e5fe --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/TemplateFunction/templates_c/f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c_0.file.test_template_function_tag4.tpl.php @@ -0,0 +1,67 @@ + +decodeProperties(array ( + 'file_dependency' => + array ( + 'f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c' => + array ( + 0 => './templates/test_template_function_tag4.tpl', + 1 => 1430802407, + 2 => 'file', + ), + ), + 'nocache_hash' => '24268554f33a14620b8_97298192', + 'variables' => + array ( + 'loop' => 0, + ), + 'has_nocache_code' => false, + 'version' => '3.1.22-dev/32', + 'unifunc' => 'content_554f33a148afb4_17621827', + 'tpl_function' => + array ( + 'functest4' => + array ( + 'called_functions' => + array ( + ), + 'compiled_filepath' => './templates_c/f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c_0.file.test_template_function_tag4.tpl.php', + 'uid' => 'f07aa3eeb4dea4c19bbd2f4c2ae3f28f1776589c', + 'call_name' => 'smarty_template_function_functest4_24268554f33a14620b8_97298192', + ), + ), +),false); +/*/%%SmartyHeaderCode%%*/ +if ($_valid && !is_callable('content_554f33a148afb4_17621827')) { +function content_554f33a148afb4_17621827 ($_smarty_tpl) { +?> +properties['nocache_hash'] = '24268554f33a14620b8_97298192'; +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array(), true);?> +tpl_vars; +$params = array_merge(array('loop'=>0), $params); +foreach ($params as $key => $value) { +$_smarty_tpl->tpl_vars[$key] = new Smarty_Variable($value); +} +echo $_smarty_tpl->tpl_vars['loop']->value; +if ($_smarty_tpl->tpl_vars['loop']->value<5) { +$_smarty_tpl->callTemplateFunction ('functest4', $_smarty_tpl, array('loop'=>$_smarty_tpl->tpl_vars['loop']->value+1), false); +} +foreach (Smarty::$global_tpl_vars as $key => $value){ +if ($_smarty_tpl->tpl_vars[$key] === $value) $saved_tpl_vars[$key] = $value; +} +$_smarty_tpl->tpl_vars = $saved_tpl_vars; +} +} +/*/ smarty_template_function_functest4_24268554f33a14620b8_97298192 */ + +?>