mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 02:44:27 +02:00
check plugin loading
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user