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

Not allowed!

', '

Not allowed!

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

Not allowed!

', '

Not allowed!

' ); } function testNestedChameleonPreserveBlockInBlock() { $this->assertResult( '
Allowed!
' ); } function testChameleonEscapeInvalidBlockInInline() { $this->config->set('Core.EscapeInvalidChildren', true); $this->assertResult( // alt config '
Not allowed!
', '<div>Not allowed!</div>' ); } function testExclusionsIntegration() { // test exclusions $this->assertResult( 'Not allowed', '' ); } function testPreserveInlineNodeInInlineRootNode() { $this->config->set('HTML.Parent', 'span'); $this->assertResult('Bold'); } function testRemoveBlockNodeInInlineRootNode() { $this->config->set('HTML.Parent', 'span'); $this->assertResult('
Reject
', 'Reject'); } 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
'); } function testCascadingRemovalOfNodesMissingRequiredChildren() { $this->assertResult('
', ''); } function testCascadingRemovalSpecialCaseCannotScrollOneBack() { $this->assertResult('
', ''); } function testLotsOfCascadingRemovalOfNodes() { $this->assertResult('
', ''); } function testAdjacentRemovalOfNodeMissingRequiredChildren() { $this->assertResult('
', ''); } function testStrictBlockquoteInHTML401() { $this->config->set('HTML.Doctype', 'HTML 4.01 Strict'); $this->assertResult('
text
', '

text

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