From 06c4eac7c06c73223c9b4fe3cc6a1642e8d461aa Mon Sep 17 00:00:00 2001 From: uwetews Date: Sun, 11 Nov 2018 18:35:00 +0100 Subject: [PATCH] fix {insert} test --- .../TemplateSource/TagTests/Insert/CompileInsertTest.php | 6 ++++-- .../TagTests/Insert/PHPunitplugins/insert.test2.php | 5 +++-- .../TagTests/Insert/templates/insertplugintest2.tpl | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php b/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php index 536b691e..61e8835c 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Insert/CompileInsertTest.php @@ -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')); } diff --git a/tests/UnitTests/TemplateSource/TagTests/Insert/PHPunitplugins/insert.test2.php b/tests/UnitTests/TemplateSource/TagTests/Insert/PHPunitplugins/insert.test2.php index 597ffd1e..bfc35e12 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Insert/PHPunitplugins/insert.test2.php +++ b/tests/UnitTests/TemplateSource/TagTests/Insert/PHPunitplugins/insert.test2.php @@ -1,5 +1,6 @@ tpl_vars[$params['var']]->value; } diff --git a/tests/UnitTests/TemplateSource/TagTests/Insert/templates/insertplugintest2.tpl b/tests/UnitTests/TemplateSource/TagTests/Insert/templates/insertplugintest2.tpl index 0ad560d1..a1834ab0 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Insert/templates/insertplugintest2.tpl +++ b/tests/UnitTests/TemplateSource/TagTests/Insert/templates/insertplugintest2.tpl @@ -1,2 +1,2 @@ -{insert name='test2'} +{insert name='test2' var='insert'} {include 'inner.tpl'} \ No newline at end of file