obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); } public function testEmptyInput() { $this->assertResult(''); } public function testPreserveValidP() { $this->assertResult('

Valid

'); } public function testPreserveValidDiv() { $this->assertResult('
Still valid
'); } public function testWrapTextWithP() { $this->assertResult('Needs wrap', '

Needs wrap

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

Do not wrap

Whitespace

'); } public function testWrapTextNextToValidElements() { $this->assertResult( 'Wrap'. '

Do not wrap

', '

Wrap

Do not wrap

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

Do not

'.'Wrap', '

Do not

Wrap

' ); } public function testWrapAndRemoveInvalidTags() { $this->assertResult( '
  • Not allowed
  • Paragraph.

    Hmm.

    ', '

    Not allowedParagraph.

    Hmm.

    ' ); } public function testWrapComplicatedSring() { $this->assertResult( $var = 'He said
    perhaps
    we should nuke them.', "

    $var

    " ); } public function testWrapAndRemoveInvalidTagsComplex() { $this->assertResult( 'BarPeopleConniving.'. '

    Fools!

    ', '

    Bar'. 'PeopleConniving.

    Fools!

    ' ); } public function testAlternateWrapper() { $this->config->set('HTML.BlockWrapper', 'div'); $this->assertResult('Needs wrap', '
    Needs wrap
    '); } public function testError() { $this->expectError('Cannot use non-block element as block wrapper'); $this->obj = new HTMLPurifier_ChildDef_StrictBlockquote('div | p'); $this->config->set('HTML.BlockWrapper', 'dav'); $this->config->set('Cache.DefinitionImpl', null); $this->assertResult('Needs wrap', '

    Needs wrap

    '); } } // vim: et sw=4 sts=4