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

Commit 433963f

Browse files
committed
update strip test
1 parent 259613f commit 433963f

File tree

4 files changed

+42
-3
lines changed

4 files changed

+42
-3
lines changed

UnitTests/TemplateSource/TagTests/Strip/CompileStripTest.php

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,26 @@ public function testInit()
2828
/**
2929
* test strip tag
3030
*/
31-
public function testStrip()
31+
public function testStripTag()
3232
{
33-
$tpl = $this->smarty->createTemplate("eval:{strip}<table>\n </table>{/strip}");
34-
$this->assertEquals('<table></table>', $this->smarty->fetch($tpl));
33+
$this->assertContains('foobar buh', $this->smarty->fetch('strip.tpl'));
34+
}
35+
/**
36+
* test strip tag multi line html
37+
*/
38+
public function testStripMultiLineHtmlTag()
39+
{
40+
$this->assertContains('<div style="float: right; cursor: url;">[<a onmouseover="this.style.cursor=\'pointer\'" onmouseup="document.getElementById(\'screenEdit_($screen.id)\').style.display=\'none\'";>X</a>]</div>foobar', $this->smarty->fetch('strip_multi_line_html_tag.tpl'));
41+
}
42+
/**
43+
* test strip tag multi line html
44+
*/
45+
public function testStripMultiLineTextareaHtmlTag()
46+
{
47+
$this->assertContains(preg_replace('/[\r]/', '', '<textarea>
48+
49+
some text
50+
51+
</textarea> foobar'), $this->smarty->fetch('strip_multi_line_textarea_html_tag.tpl'));
3552
}
3653
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{strip}
2+
foo
3+
bar buh
4+
5+
{/strip}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{strip}
2+
<div style="float: right; cursor: url;">[<a
3+
onmouseover="this.style.cursor='pointer'"
4+
onmouseup="document.getElementById('screenEdit_($screen.id)').style.display='none'";>X</a>]</div>
5+
6+
7+
foo
8+
bar
9+
{/strip}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{strip}
2+
<textarea>
3+
4+
some text
5+
6+
</textarea> foo
7+
bar
8+
{/strip}

0 commit comments

Comments
 (0)