mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-03 18:04:26 +02:00
fix {insert} test
This commit is contained in:
@@ -202,7 +202,8 @@ class CompileInsertTest extends PHPUnit_Smarty
|
||||
public function testInsertPluginCaching3_1()
|
||||
{
|
||||
$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);
|
||||
$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
|
||||
|
||||
function smarty_insert_test2($params, &$smarty) {
|
||||
return time();
|
||||
function smarty_insert_test2($params, $smarty) {
|
||||
|
||||
return $smarty->tpl_vars[$params['var']]->value;
|
||||
}
|
||||
|
@@ -1,2 +1,2 @@
|
||||
{insert name='test2'}
|
||||
{insert name='test2' var='insert'}
|
||||
{include 'inner.tpl'}
|
Reference in New Issue
Block a user