Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit e53f423

Browse files
committed
fix {insert} test
1 parent ba0c4f0 commit e53f423

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,8 @@ public function testInsertPluginCaching2_2()
202202
public function testInsertPluginCaching3_1()
203203
{
204204
$this->smarty->caching = true;
205-
$this->assertContains(time().'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
205+
$this->smarty->assign('insert',$t=time());
206+
$this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
206207
}
207208

208209
/**
@@ -214,7 +215,8 @@ public function testInsertPluginCaching3_2()
214215
{
215216
sleep(2);
216217
$this->smarty->caching = true;
217-
$this->assertContains(time().'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
218+
$this->smarty->assign('insert',$t=time());
219+
$this->assertContains($t.'Inner template', $this->smarty->fetch('insertplugintest2.tpl'));
218220
}
219221

220222

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3-
function smarty_insert_test2($params, &$smarty) {
4-
return time();
3+
function smarty_insert_test2($params, $smarty) {
4+
5+
return $smarty->tpl_vars[$params['var']]->value;
56
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
{insert name='test2'}
1+
{insert name='test2' var='insert'}
22
{include 'inner.tpl'}

0 commit comments

Comments
 (0)