Add vim modelines to all files.
[htmlpurifier.git] / tests / HTMLPurifier / Strategy / MakeWellFormedTest.php
blob3d6892d2cf3abbb7ea86080d4bcfd51aa589a05c
1 <?php
3 class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarness
6 function setUp() {
7 parent::setUp();
8 $this->obj = new HTMLPurifier_Strategy_MakeWellFormed();
11 function testEmptyInput() {
12 $this->assertResult('');
15 function testWellFormedInput() {
16 $this->assertResult('This is <b>bold text</b>.');
19 function testUnclosedTagTerminatedByDocumentEnd() {
20 $this->assertResult(
21 '<b>Unclosed tag, gasp!',
22 '<b>Unclosed tag, gasp!</b>'
26 function testUnclosedTagTerminatedByParentNodeEnd() {
27 $this->assertResult(
28 '<b><i>Bold and italic?</b>',
29 '<b><i>Bold and italic?</i></b>'
33 function testRemoveStrayClosingTag() {
34 $this->assertResult(
35 'Unused end tags... recycle!</b>',
36 'Unused end tags... recycle!'
40 function testConvertStartToEmpty() {
41 $this->assertResult(
42 '<br style="clear:both;">',
43 '<br style="clear:both;" />'
47 function testConvertEmptyToStart() {
48 $this->assertResult(
49 '<div style="clear:both;" />',
50 '<div style="clear:both;"></div>'
54 function testAutoCloseParagraph() {
55 $this->assertResult(
56 '<p>Paragraph 1<p>Paragraph 2',
57 '<p>Paragraph 1</p><p>Paragraph 2</p>'
61 function testAutoCloseParagraphInsideDiv() {
62 $this->assertResult(
63 '<div><p>Paragraphs<p>In<p>A<p>Div</div>',
64 '<div><p>Paragraphs</p><p>In</p><p>A</p><p>Div</p></div>'
68 function testAutoCloseListItem() {
69 $this->assertResult(
70 '<ol><li>Item 1<li>Item 2</ol>',
71 '<ol><li>Item 1</li><li>Item 2</li></ol>'
75 function testAutoCloseColgroup() {
76 $this->assertResult(
77 '<table><colgroup><col /><tr></tr></table>',
78 '<table><colgroup><col /></colgroup><tr></tr></table>'
82 function testAutoCloseMultiple() {
83 $this->assertResult(
84 '<span><span><div></div>',
85 '<span><span></span></span><div></div>'
89 function testUnrecognized() {
90 $this->assertResult(
91 '<asdf><foobar /><biddles>foo</asdf>',
92 '<asdf><foobar /><biddles>foo</biddles></asdf>'
96 function testBlockquoteWithInline() {
97 $this->config->set('HTML', 'Doctype', 'XHTML 1.0 Strict');
98 $this->assertResult(
99 // This is actually invalid, but will be fixed by
100 // ChildDef_StrictBlockquote
101 '<blockquote>foo<b>bar</b></blockquote>'
107 // vim: et sw=4 sts=4