obj = new HTMLPurifier_Strategy_ValidateAttributes(); } function test() { // attribute order is VERY fragile, perhaps we should define // an ordering scheme! $this->assertResult(''); // test ids $this->assertResult('
Preserve the ID.
'); $this->assertResult( '
Kill the ID.
', '
Kill the ID.
' ); // test id accumulator $this->assertResult( '
Valid
Invalid
', '
Valid
Invalid
' ); $this->assertResult( 'Bad dir.', 'Bad dir.' ); // test attribute key case sensitivity $this->assertResult( '
Convert ID to lowercase.
', '
Convert ID to lowercase.
' ); // test simple attribute substitution $this->assertResult( '
Trim whitespace.
', '
Trim whitespace.
' ); // test configuration id blacklist $this->assertResult( '
Invalid
', '
Invalid
', array('Attr.IDBlacklist' => array('invalid')) ); // test classes $this->assertResult('
Valid
'); $this->assertResult( '
Keep valid.
', '
Keep valid.
' ); // test title $this->assertResult( 'PHP' ); // test lang $this->assertResult( 'La soupe.', 'La soupe.' ); // test align $this->assertResult( '

Centered Headline

', '

Centered Headline

' ); // test table $this->assertResult( '
Fiddly name Super-duper-price
Carrot Humungous $500.23
Taken off the market
' ); // test URI $this->assertResult('Google'); // test invalid URI $this->assertResult( 'Google', 'Google' ); // test required attributes for img $this->assertResult( '', 'Invalid image' ); $this->assertResult( '', 'foobar.jpg' ); $this->assertResult( 'pretty picture', 'pretty picture' ); // test required attributes for bdo $this->assertResult( 'Go left.', 'Go left.' ); $this->assertResult( 'Invalid value!', 'Invalid value!' ); // comparison check for test 20 $this->assertResult( 'Invalid value!', 'Invalid value!' ); // test col.span is non-zero $this->assertResult( '', '' ); } } ?>