Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit a45da3b

Browse files
committed
check plugin loading
1 parent 0d9110f commit a45da3b

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

UnitTests/TemplateSource/TagTests/FunctionPlugin/CompileFunctionPluginTest.php

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,13 @@ public function testInit()
2525

2626
/**
2727
* test function plugin nocache tag
28-
* @runInSeparateProcess
2928
*/
3029
public function testFunctionPluginFromTemplateFileNocache1()
3130
{
3231
$this->smarty->setCaching(true);
33-
$this->assertEquals("1", $this->smarty->fetch('functionplugintestnocache.tpl'));
34-
}
35-
/**
36-
* test function plugin tag in template file
37-
* @runInSeparateProcess
38-
*/
39-
public function testFunctionPluginFromTemplateFileNocache2()
40-
{
41-
$this->smarty->setCaching(true);
42-
$this->assertEquals("1", $this->smarty->fetch('functionplugintestnocache.tpl'));
32+
$tpl = $this->smarty->createTemplate('functionplugintestnocache.tpl', $this->smarty);
33+
$this->assertEquals("1", $this->smarty->fetch($tpl));
34+
$this->assertContains("%%*/<?php \$_smarty = \$_smarty_tpl->smarty; if (!is_callable(\\'smarty_function_counter\\'))", file_get_contents($tpl->compiled->filepath));
4335
}
4436

4537
/**
@@ -49,6 +41,7 @@ public function testFunctionPluginFromTemplateFile()
4941
{
5042
$tpl = $this->smarty->createTemplate('functionplugintest.tpl', $this->smarty);
5143
$this->assertEquals("10", $this->smarty->fetch($tpl));
44+
$this->assertContains("if (!is_callable('smarty_function_counter'))", file_get_contents($tpl->compiled->filepath));
5245
}
5346
/**
5447
* test function plugin tag in compiled template file

0 commit comments

Comments
 (0)