obj = new HTMLPurifier_Strategy_FixNesting(); } public function testPreserveInlineInRoot() { $this->assertResult('Bold text'); } public function testPreserveInlineAndBlockInRoot() { $this->assertResult('Blank
Block
'); } public function testRemoveBlockInInline() { $this->assertResult( '
Illegal div.
', 'Illegal div.' ); } public function testEscapeBlockInInline() { $this->config->set('Core.EscapeInvalidChildren', true); $this->assertResult( '
Illegal div.
', '<div>Illegal div.</div>' ); } public function testRemoveNodeWithMissingRequiredElements() { $this->assertResult('', ''); } public function testListHandleIllegalPCDATA() { $this->assertResult( '', '' ); } public function testRemoveIllegalPCDATA() { $this->assertResult( 'Illegal text
', '
' ); } public function testCustomTableDefinition() { $this->assertResult('
Cell 1
'); } public function testRemoveEmptyTable() { $this->assertResult('
', ''); } public function testChameleonRemoveBlockInNodeInInline() { $this->assertResult( '
Not allowed!
', 'Not allowed!' ); } public function testChameleonRemoveBlockInBlockNodeWithInlineContent() { $this->assertResult( '

Not allowed!

', '

Not allowed!

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

Not allowed!

', '

Not allowed!

' ); } public function testNestedChameleonPreserveBlockInBlock() { $this->assertResult( '
Allowed!
' ); } public function testChameleonEscapeInvalidBlockInInline() { $this->config->set('Core.EscapeInvalidChildren', true); $this->assertResult( // alt config '
Not allowed!
', '<div>Not allowed!</div>' ); } public function testExclusionsIntegration() { // test exclusions $this->assertResult( 'Not allowed', '' ); } public function testPreserveInlineNodeInInlineRootNode() { $this->config->set('HTML.Parent', 'span'); $this->assertResult('Bold'); } public function testRemoveBlockNodeInInlineRootNode() { $this->config->set('HTML.Parent', 'span'); $this->assertResult('
Reject
', 'Reject'); } public function testInvalidParentError() { // test fallback to div $this->config->set('HTML.Parent', 'obviously-impossible'); $this->config->set('Cache.DefinitionImpl', null); $this->expectError('Cannot use unrecognized element as parent'); $this->assertResult('
Accept
'); } public function testCascadingRemovalOfNodesMissingRequiredChildren() { $this->assertResult('
', ''); } public function testCascadingRemovalSpecialCaseCannotScrollOneBack() { $this->assertResult('
', ''); } public function testLotsOfCascadingRemovalOfNodes() { $this->assertResult('
', ''); } public function testAdjacentRemovalOfNodeMissingRequiredChildren() { $this->assertResult('
', ''); } public function testStrictBlockquoteInHTML401() { $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); $this->assertResult('
text
', '

text

'); } public function testDisabledExcludes() { $this->config->set('Core.DisableExcludes', true); $this->assertResult('
'); } } // vim: et sw=4 sts=4