From 2dba744fcbf5b02252297655b417034b51468ee9 Mon Sep 17 00:00:00 2001 From: uwetews Date: Wed, 10 Feb 2016 21:06:19 +0100 Subject: [PATCH] Update function plugin teste --- .../TagTests/FunctionPlugin/CompileFunctionPluginTest.php | 6 ++++-- .../FunctionPlugin/templates/functionplugintestnocache.tpl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php index 2ed5f75b..b17580ba 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php @@ -18,6 +18,7 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty public function setUp() { $this->setUpSmarty(dirname(__FILE__)); + $this->smarty->addPluginsDir("../../../__shared/PHPunitplugins/"); } public function testInit() @@ -30,10 +31,11 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty */ public function testFunctionPluginFromTemplateFileNocache1() { + $this->smarty->assign('foo',5); $this->smarty->setCaching(true); $tpl = $this->smarty->createTemplate('functionplugintestnocache.tpl', $this->smarty); - $this->assertEquals("2", $this->smarty->fetch($tpl)); - $this->assertContains("%%*/smarty; if (!is_callable(\\'smarty_function_counter\\'))", file_get_contents($tpl->compiled->filepath)); + $this->assertEquals("5", $this->smarty->fetch($tpl)); + $this->assertContains("%%*/smarty; if (!is_callable(\\'smarty_function_getvar\\'))", file_get_contents($tpl->compiled->filepath)); } /** diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl index c4e1f8b0..9134519a 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/templates/functionplugintestnocache.tpl @@ -1 +1 @@ -{counter nocache} \ No newline at end of file +{getvar var=foo nocache} \ No newline at end of file