obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config->set('AutoFormat', 'AutoParagraph', true); $this->config->set('AutoFormat', 'Linkify', true); } function testOnlyAutoParagraph() { $this->assertResult( 'Foobar', '

Foobar

' ); } function testParagraphWrappingOnlyLink() { $this->assertResult( 'http://example.com', '

http://example.com

' ); } function testParagraphWrappingNodeContainingLink() { $this->assertResult( 'http://example.com', '

http://example.com

' ); } function testParagraphWrappingPoorlyFormedNodeContainingLink() { $this->assertResult( 'http://example.com', '

http://example.com

' ); } function testTwoParagraphsContainingOnlyOneLink() { $this->assertResult( "http://example.com\n\nhttp://dev.example.com", '

http://example.com

http://dev.example.com

' ); } function testParagraphNextToDivWithLinks() { $this->assertResult( 'http://example.com
http://example.com
', '

http://example.com

http://example.com
' ); } function testRealisticLinkInSentence() { $this->assertResult( 'This URL http://example.com is what you need', '

This URL http://example.com is what you need

' ); } }