fix {insert} test

This commit is contained in:
uwetews
2018-11-11 18:35:00 +01:00
parent adbcf8a014
commit 06c4eac7c0
3 changed files with 8 additions and 5 deletions

View File

@@ -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'));
}

View File

@@ -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;
}

View File

@@ -1,2 +1,2 @@
{insert name='test2'}
{insert name='test2' var='insert'}
{include 'inner.tpl'}