From 788aa586325c964ad06b8f35f30318c9f19281d2 Mon Sep 17 00:00:00 2001 From: uwetews Date: Sat, 20 Feb 2016 17:17:21 +0100 Subject: [PATCH] Update strip text --- .../TagTests/Strip/CompileStripTest.php | 38 ++++++++++++------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php index a34fca5a..c32490cc 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php @@ -10,7 +10,7 @@ * class for strip tags tests * * @runTestsInSeparateProcess - * @preserveGlobalState disabled + * @preserveGlobalState disabled * @backupStaticAttributes enabled */ class CompileStripTest extends PHPUnit_Smarty @@ -22,7 +22,6 @@ class CompileStripTest extends PHPUnit_Smarty $this->smarty->addTemplateDir("./templates_tmp"); } - public function testInit() { $this->cleanDirs(); @@ -31,7 +30,7 @@ class CompileStripTest extends PHPUnit_Smarty /** * Test {strip} tags * - * @not runInSeparateProcess + * @not runInSeparateProcess * @preserveGlobalState disabled * @dataProvider dataTestStrip */ @@ -40,7 +39,7 @@ class CompileStripTest extends PHPUnit_Smarty $file = "testStrip_{$testNumber}.tpl"; $this->makeTemplateFile($file, "{strip}\n" . $code); $this->smarty->assignGlobal('file', $file); - $this->assertEquals($this->strip($result), $this->strip($this->smarty->fetch($file)), "testStrip - {$code} - {$testName}"); + $this->assertEquals($result, $this->smarty->fetch($file), "testStrip - {$code} - {$testName}"); } /* @@ -54,16 +53,29 @@ class CompileStripTest extends PHPUnit_Smarty * result * test name */ - return array( - array(" foo\n bar buh\n\n", 'foobar buh', '', $i ++), - array("\n
[X]
\n\n\n foo\n bar\n", '
[X]
foobar', '', $i ++), - array("\n \n", '', '', $i ++), - array("\n foo\n bar\n", " foobar", '', $i ++), + return array(array(" foo\n bar buh\n\n", 'foobar buh', '', $i ++), + array("\n
[X]
\n\n\n foo\n bar\n", + '
[X]
foobar', + '', $i ++), + array("\n \n", + '', '', $i ++), + array("\n foo\n bar\n", + " foobar", '', $i ++), // variable in html tag - array("{\$foo=1}\n

{getvar var=foo} italic

\n", '

1 italic

', '', $i ++), - array("{\$foo=1}\n

{getvar var=foo assign=newvar} italic

\n", '

italic

', '', $i ++), - array("{\$text=\"Text\"}\n#{\$text}#\n", '#Text#', '', $i ++), - array("{\$text=\"Text\"}\n# {'Text'}\n", '# Text', '', $i ++), + array("\n c\n", 'c', '', $i ++), + array("\n c\n", ' c', '', $i ++), + array("\n \nc\n", ' c', '', $i ++), + array("{\$foo=1}\n {\$foo}c\n", '1c', '', $i ++), + array("{\$foo=1}\n {\$foo} c\n", '1 c', '', $i ++), + array("{\$foo=1}\n \n{\$foo} c\n", '1 c', '', $i ++), + array("\n#{'Text'}#\n", '#Text#', '', $i ++), + array("\n# {'Text'}\n", '# Text', '', $i ++), + array("\n# {'Text'}\n", '# Text', '', $i ++), + array("\n", '', '', $i ++), + array("{'Var'}\n ", 'Var ', '', $i ++), + array("{'Var'}\n ", 'Var ', '', $i ++), + array("\n ", ' ', '', $i ++), + array("\n\n ", ' ', '', $i ++), ); }