From c34c178053f0dbd823a6222fa97b9062d92baca1 Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Thu, 18 Jun 2015 01:45:13 +0200 Subject: [PATCH] check plugin loading --- .../FunctionPlugin/CompileFunctionPluginTest.php | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php index 772349ea..69f7f7b4 100644 --- a/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php @@ -25,21 +25,13 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty /** * test function plugin nocache tag - * @runInSeparateProcess */ public function testFunctionPluginFromTemplateFileNocache1() { $this->smarty->setCaching(true); - $this->assertEquals("1", $this->smarty->fetch('functionplugintestnocache.tpl')); - } - /** - * test function plugin tag in template file - * @runInSeparateProcess - */ - public function testFunctionPluginFromTemplateFileNocache2() - { - $this->smarty->setCaching(true); - $this->assertEquals("1", $this->smarty->fetch('functionplugintestnocache.tpl')); + $tpl = $this->smarty->createTemplate('functionplugintestnocache.tpl', $this->smarty); + $this->assertEquals("1", $this->smarty->fetch($tpl)); + $this->assertContains("%%*/smarty; if (!is_callable(\\'smarty_function_counter\\'))", file_get_contents($tpl->compiled->filepath)); } /** @@ -49,6 +41,7 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty { $tpl = $this->smarty->createTemplate('functionplugintest.tpl', $this->smarty); $this->assertEquals("10", $this->smarty->fetch($tpl)); + $this->assertContains("if (!is_callable('smarty_function_counter'))", file_get_contents($tpl->compiled->filepath)); } /** * test function plugin tag in compiled template file