mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
fix {insert} test
This commit is contained in:
@@ -202,7 +202,8 @@ class CompileInsertTest extends PHPUnit_Smarty
|
|||||||
public function testInsertPluginCaching3_1()
|
public function testInsertPluginCaching3_1()
|
||||||
{
|
{
|
||||||
$this->smarty->caching = true;
|
$this->smarty->caching = true;
|
||||||
$this->assertContains(time().'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
|
$this->smarty->assign('insert',$t=time());
|
||||||
|
$this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -214,7 +215,8 @@ class CompileInsertTest extends PHPUnit_Smarty
|
|||||||
{
|
{
|
||||||
sleep(2);
|
sleep(2);
|
||||||
$this->smarty->caching = true;
|
$this->smarty->caching = true;
|
||||||
$this->assertContains(time().'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
|
$this->smarty->assign('insert',$t=time());
|
||||||
|
$this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function smarty_insert_test2($params, &$smarty) {
|
function smarty_insert_test2($params, $smarty) {
|
||||||
return time();
|
|
||||||
|
return $smarty->tpl_vars[$params['var']]->value;
|
||||||
}
|
}
|
||||||
|
@@ -1,2 +1,2 @@
|
|||||||
{insert name='test2'}
|
{insert name='test2' var='insert'}
|
||||||
{include 'inner.tpl'}
|
{include 'inner.tpl'}
|
Reference in New Issue
Block a user