Update function plugin teste

This commit is contained in:
uwetews
2016-02-10 21:06:19 +01:00
parent 90a4a5c28e
commit 2dba744fcb
2 changed files with 5 additions and 3 deletions

View File

@@ -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("%%*/<?php \$_smarty = \$_smarty_tpl->smarty; if (!is_callable(\\'smarty_function_counter\\'))", file_get_contents($tpl->compiled->filepath));
$this->assertEquals("5", $this->smarty->fetch($tpl));
$this->assertContains("%%*/<?php \$_smarty = \$_smarty_tpl->smarty; if (!is_callable(\\'smarty_function_getvar\\'))", file_get_contents($tpl->compiled->filepath));
}
/**

View File

@@ -1 +1 @@
{counter nocache}
{getvar var=foo nocache}