mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
update strip test
This commit is contained in:
@@ -28,9 +28,26 @@ class CompileStripTest extends PHPUnit_Smarty
|
|||||||
/**
|
/**
|
||||||
* test strip tag
|
* test strip tag
|
||||||
*/
|
*/
|
||||||
public function testStrip()
|
public function testStripTag()
|
||||||
{
|
{
|
||||||
$tpl = $this->smarty->createTemplate("eval:{strip}<table>\n </table>{/strip}");
|
$this->assertContains('foobar buh', $this->smarty->fetch('strip.tpl'));
|
||||||
$this->assertEquals('<table></table>', $this->smarty->fetch($tpl));
|
}
|
||||||
|
/**
|
||||||
|
* test strip tag multi line html
|
||||||
|
*/
|
||||||
|
public function testStripMultiLineHtmlTag()
|
||||||
|
{
|
||||||
|
$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'));
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* test strip tag multi line html
|
||||||
|
*/
|
||||||
|
public function testStripMultiLineTextareaHtmlTag()
|
||||||
|
{
|
||||||
|
$this->assertContains(preg_replace('/[\r]/', '', '<textarea>
|
||||||
|
|
||||||
|
some text
|
||||||
|
|
||||||
|
</textarea> foobar'), $this->smarty->fetch('strip_multi_line_textarea_html_tag.tpl'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,5 @@
|
|||||||
|
{strip}
|
||||||
|
foo
|
||||||
|
bar buh
|
||||||
|
|
||||||
|
{/strip}
|
@@ -0,0 +1,9 @@
|
|||||||
|
{strip}
|
||||||
|
<div style="float: right; cursor: url;">[<a
|
||||||
|
onmouseover="this.style.cursor='pointer'"
|
||||||
|
onmouseup="document.getElementById('screenEdit_($screen.id)').style.display='none'";>X</a>]</div>
|
||||||
|
|
||||||
|
|
||||||
|
foo
|
||||||
|
bar
|
||||||
|
{/strip}
|
@@ -0,0 +1,8 @@
|
|||||||
|
{strip}
|
||||||
|
<textarea>
|
||||||
|
|
||||||
|
some text
|
||||||
|
|
||||||
|
</textarea> foo
|
||||||
|
bar
|
||||||
|
{/strip}
|
Reference in New Issue
Block a user