Add output helpers
[MAILPOET-1891]
This commit is contained in:
committed by
M. Shull
parent
756ebe673b
commit
d07f64038b
26
tests/unit/Newsletter/Renderer/EscapeHelperTest.php
Normal file
26
tests/unit/Newsletter/Renderer/EscapeHelperTest.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
namespace MailPoet\Test\Newsletter;
|
||||
|
||||
use MailPoet\Newsletter\Renderer\EscapeHelper as EHelper;
|
||||
|
||||
class EscapeHelperTest extends \MailPoetUnitTest {
|
||||
|
||||
function testItEscapesHtmlText() {
|
||||
expect(EHelper::escapeHtmlText('Text<tag>\'"Hello</tag>'))
|
||||
->equals("Text<tag>'\"Hello</tag>");
|
||||
}
|
||||
|
||||
function testItEscapesHtmlAttr() {
|
||||
expect(EHelper::escapeHtmlAttr('Text<tag>\'"Hello</tag>'))
|
||||
->equals("Text<tag>'"Hello</tag>");
|
||||
}
|
||||
|
||||
function testItEscapesLinkAttr() {
|
||||
expect(EHelper::escapeHtmlLinkAttr('Text<tag>\'"Hello</tag>'))
|
||||
->equals("Text<tag>'"Hello</tag>");
|
||||
expect(EHelper::escapeHtmlLinkAttr('javaScRipt:Text<tag>\'"Hello</tag>'))
|
||||
->equals("");
|
||||
expect(EHelper::escapeHtmlLinkAttr('DAta:Text<tag>\'"Hello</tag>'))
|
||||
->equals("");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user