diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php index 07077021..ee343e39 100644 --- a/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php @@ -28,9 +28,26 @@ class CompileStripTest extends PHPUnit_Smarty /** * test strip tag */ - public function testStrip() + public function testStripTag() { - $tpl = $this->smarty->createTemplate("eval:{strip}\n
{/strip}"); - $this->assertEquals('
', $this->smarty->fetch($tpl)); + $this->assertContains('foobar buh', $this->smarty->fetch('strip.tpl')); + } + /** + * test strip tag multi line html + */ + public function testStripMultiLineHtmlTag() + { + $this->assertContains('
[X]
foobar', $this->smarty->fetch('strip_multi_line_html_tag.tpl')); + } + /** + * test strip tag multi line html + */ + public function testStripMultiLineTextareaHtmlTag() + { + $this->assertContains(preg_replace('/[\r]/', '', ' foobar'), $this->smarty->fetch('strip_multi_line_textarea_html_tag.tpl')); } } diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip.tpl b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip.tpl new file mode 100644 index 00000000..8d835418 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip.tpl @@ -0,0 +1,5 @@ +{strip} + foo + bar buh + +{/strip} diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_html_tag.tpl b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_html_tag.tpl new file mode 100644 index 00000000..30115af4 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_html_tag.tpl @@ -0,0 +1,9 @@ +{strip} +
[X]
+ + + foo + bar +{/strip} diff --git a/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_textarea_html_tag.tpl b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_textarea_html_tag.tpl new file mode 100644 index 00000000..df392809 --- /dev/null +++ b/tests/UnitTests/TemplateSource/TagTests/Strip/templates/strip_multi_line_textarea_html_tag.tpl @@ -0,0 +1,8 @@ +{strip} + foo + bar +{/strip}