obj = new HTMLPurifier_Strategy_MakeWellFormed(); } public function testEmptyInput() { $this->assertResult(''); } public function testWellFormedInput() { $this->assertResult('This is bold text.'); } public function testUnclosedTagTerminatedByDocumentEnd() { $this->assertResult( 'Unclosed tag, gasp!', 'Unclosed tag, gasp!' ); } public function testUnclosedTagTerminatedByParentNodeEnd() { $this->assertResult( 'Bold and italic?', 'Bold and italic?' ); } public function testRemoveStrayClosingTag() { $this->assertResult( 'Unused end tags... recycle!', 'Unused end tags... recycle!' ); } public function testConvertStartToEmpty() { $this->assertResult( '
', '
' ); } public function testConvertEmptyToStart() { $this->assertResult( '
', '
' ); } public function testAutoCloseParagraph() { $this->assertResult( '

Paragraph 1

Paragraph 2', '

Paragraph 1

Paragraph 2

' ); } public function testAutoCloseParagraphInsideDiv() { $this->assertResult( '

Paragraphs

In

A

Div

', '

Paragraphs

In

A

Div

' ); } public function testAutoCloseListItem() { $this->assertResult( '
  1. Item 1
  2. Item 2
', '
  1. Item 1
  2. Item 2
' ); } public function testAutoCloseColgroup() { $this->assertResult( '
', '
' ); } public function testAutoCloseMultiple() { $this->assertResult( '
asdf', '
asdf' ); } public function testUnrecognized() { $this->assertResult( 'foo', 'foo' ); } public function testBlockquoteWithInline() { $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); $this->assertResult( // This is actually invalid, but will be fixed by // ChildDef_StrictBlockquote '
foobar
' ); } public function testLongCarryOver() { $this->assertResult( 'asdf
asdfdf
asdf
', 'asdf
asdfdf
asdf' ); } public function testInterleaved() { $this->assertResult( 'foobarbaz', 'foobarbaz' ); } public function testNestedOl() { $this->assertResult( '
    1. foo
', '
    1. foo
' ); } public function testNestedUl() { $this->assertResult( '
    • foo
', '
    • foo
' ); } public function testNestedOlWithStrangeEnding() { $this->assertResult( '
      1. foo
    1. foo
    ', '
        1. foo
    1. foo
    ' ); } public function testNoAutocloseIfNoParentsCanAccomodateTag() { $this->assertResult( '
  1. foo
  2. ', '
    foo
    ' ); } } // vim: et sw=4 sts=4