From 9d52ba99f72377af1f5b77d676d74f679c0a111f Mon Sep 17 00:00:00 2001 From: Uwe Tews Date: Mon, 20 Nov 2017 11:10:45 +0100 Subject: [PATCH] Extend setfilter tag test --- .../SetFilter/CompileSetfilterTest.php | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php index 21227faa..f0cd25fa 100644 --- a/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/SetFilter/CompileSetfilterTest.php @@ -26,10 +26,29 @@ class CompileSetfilterTest extends PHPUnit_Smarty $this->cleanDirs(); } /** - * @runInSeparateProcess + * @run + * InSeparateProcess * @preserveGlobalState disabled */ public function testNestedSetfilter() + { + $this->smarty->setCaching(1); + $tpl = $this->smarty->createTemplate('string:{$foo}{setfilter htmlspecialchars} {$foo}{$foo nocache}{setfilter escape:"mail"} {$foo}{$foo nocache}{/setfilter} {$foo}{/setfilter} {$foo}'); + $tpl->assign('foo', ''); + $this->assertEquals(" <a@b.c><a@b.c> <a@b.c> ", $this->smarty->fetch($tpl)); + } + public function testNestedSetfilter1() + { + $this->smarty->setCaching(1); + $tpl = $this->smarty->createTemplate('string:{$foo}{setfilter htmlspecialchars} {$foo}{$foo nocache}{setfilter escape:"mail"} {$foo}{$foo nocache}{/setfilter} {$foo}{/setfilter} {$foo}'); + $tpl->assign('foo', ''); + $this->assertEquals( } +" <a@b.c><e@f.d> <a@b.c> ", $this->smarty->fetch($tpl)); + /** + * @runInSeparateProcess + * @preserveGlobalState disabled + */ + public function testNestedSetfilter2() { $tpl = $this->smarty->createTemplate('string:{$foo}{setfilter htmlspecialchars} {$foo}{setfilter escape:"mail"} {$foo}{/setfilter} {$foo}{/setfilter} {$foo}'); $tpl->assign('foo', '');