check plugin loading

This commit is contained in:
Uwe Tews
2015-06-18 01:45:13 +02:00
parent e5b3da5b38
commit c34c178053

View File

@@ -25,21 +25,13 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty
/** /**
* test function plugin nocache tag * test function plugin nocache tag
* @runInSeparateProcess
*/ */
public function testFunctionPluginFromTemplateFileNocache1() public function testFunctionPluginFromTemplateFileNocache1()
{ {
$this->smarty->setCaching(true); $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("%%*/<?php \$_smarty = \$_smarty_tpl->smarty; if (!is_callable(\\'smarty_function_counter\\'))", file_get_contents($tpl->compiled->filepath));
* test function plugin tag in template file
* @runInSeparateProcess
*/
public function testFunctionPluginFromTemplateFileNocache2()
{
$this->smarty->setCaching(true);
$this->assertEquals("1", $this->smarty->fetch('functionplugintestnocache.tpl'));
} }
/** /**
@@ -49,6 +41,7 @@ class CompileFunctionPluginTest extends PHPUnit_Smarty
{ {
$tpl = $this->smarty->createTemplate('functionplugintest.tpl', $this->smarty); $tpl = $this->smarty->createTemplate('functionplugintest.tpl', $this->smarty);
$this->assertEquals("10", $this->smarty->fetch($tpl)); $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 * test function plugin tag in compiled template file