obj = new HTMLPurifier_Strategy_MakeWellFormed(); $this->config = array(); } function testNormalIntegration() { $this->assertResult(''); $this->assertResult('This is bold text.'); } function testUnclosedTagIntegration() { $this->assertResult( 'Unclosed tag, gasp!', 'Unclosed tag, gasp!' ); $this->assertResult( 'Bold and italic?', 'Bold and italic?' ); $this->assertResult( 'Unused end tags... recycle!', 'Unused end tags... recycle!' ); } function testEmptyTagDetectionIntegration() { $this->assertResult( '
', '
' ); $this->assertResult( '
', '
' ); } function testAutoClose() { // paragraph $this->assertResult( '

Paragraph 1

Paragraph 2', '

Paragraph 1

Paragraph 2

' ); $this->assertResult( '

Paragraphs

In

A

Div

', '

Paragraphs

In

A

Div

' ); // list $this->assertResult( '
  1. Item 1
  2. Item 2
', '
  1. Item 1
  2. Item 2
' ); // colgroup $this->assertResult( '
', '
' ); } function testAutoParagraph() { $this->config = array('Core.AutoParagraph' => true); $this->assertResult( 'Foobar', '

Foobar

' ); $this->assertResult( 'Par 1 Par 1 still', '

Par 1 Par 1 still

' ); $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); $this->assertResult( 'Par1 Par2', '

Par1

Par2

' ); $this->assertResult( 'Par1 Par2', '

Par1 Par2

' ); $this->assertResult( 'Par1

Par2

', '

Par1

Par2

' ); $this->assertResult( 'Par1', '

Par1

' ); $this->assertResult( '
Par1

Par1
' ); $this->assertResult( 'Par1 ', '

Par1

' ); $this->assertResult( 'Par1
Par2
Par3', '

Par1

Par2

Par3

' ); $this->assertResult( 'Par1', '

Par1

' ); $this->assertResult( ' Par', '

Par

' ); $this->assertResult( ' Par ', '

Par

' ); } function testLinkify() { $this->config = array('Core.AutoLinkify' => true); $this->assertResult( 'http://example.com', 'http://example.com' ); $this->assertResult( 'http://example.com', 'http://example.com' ); $this->assertResult( 'This URL http://example.com is what you need', 'This URL http://example.com is what you need' ); $this->assertResult( 'http://example.com/' ); } function testMultipleInjectors() { $this->config = array('Core.AutoParagraph' => true, 'Core.AutoLinkify' => true); $this->assertResult( 'Foobar', '

Foobar

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

http://example.com

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

http://example.com

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

http://example.com

' ); $this->assertResult( 'http://example.com http://dev.example.com', '

http://example.com

http://dev.example.com

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

http://example.com

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

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

' ); } } ?>