Add more unit tests for is_html_content()

This commit is contained in:
Kijin Sung 2017-06-29 19:54:33 +09:00
parent db8aa6fc2d
commit 8c752b9baf

View file

@ -176,9 +176,11 @@ class FunctionsTest extends \Codeception\TestCase\Test
$this->assertTrue(is_html_content("Hello<br />\nWorld"));
$this->assertTrue(is_html_content("<p class='foo'>Hello</p>\n<p class='bar'>World</p>"));
$this->assertTrue(is_html_content("<div>Hello<br>\r\n\n\n\n\nWorld</div>"));
$this->assertTrue(is_html_content('<p style="margin-top:16px">이럴 때는 &lt;p&gt; 태그나 &lt;span&gt; 태그를 사용해야 합니다.</p>'));
$this->assertTrue(is_html_content('This is <span style="font-style:italic">italic</span> text.'));
$this->assertFalse(is_html_content('This is an empty <span></span> tag. Most editors don\'t produce these.'));
$this->assertFalse(is_html_content("You have to use a <p> tag."));
$this->assertFalse(is_html_content('The <p class="foobar"> tag is the most appropriate here.'));
$this->assertFalse(is_html_content("이럴 때는 <p> 태그나 <span> 태그를 사용해야 합니다."));
$this->assertFalse(is_html_content("This is multiline content.\n<p> tag is here.\nOther lines are here, too.<br>\nMost lines don't have any tags."));
$this->assertFalse(is_html_content("<p> tag is unbalanced here.\nAnother line!<br />\nAnd a dangling line..."));
$this->assertFalse(is_html_content("Looks like a broken editor<br />\nthat produced\nthis kind of\nstring!</div>"));