obj = new HTMLPurifier_Strategy_ValidateAttributes(); } function testEmptyInput() { $this->assertResult(''); } function testRemoveIDByDefault() { $this->assertResult( '
Kill the ID.
', '
Kill the ID.
' ); } function testRemoveInvalidDir() { $this->assertResult( 'Bad dir.', 'Bad dir.' ); } function testPreserveValidClass() { $this->assertResult('
Valid
'); } function testSelectivelyRemoveInvalidClasses() { $this->config->set('HTML.Doctype', 'XHTML 1.1'); $this->assertResult( '
Keep valid.
', '
Keep valid.
' ); } function testPreserveTitle() { $this->assertResult( 'PHP' ); } function testAddXMLLang() { $this->assertResult( 'La soupe.', 'La soupe.' ); } function testOnlyXMLLangInXHTML11() { $this->config->set('HTML.Doctype', 'XHTML 1.1'); $this->assertResult( 'asdf', 'asdf' ); } function testBasicURI() { $this->assertResult('Google'); } function testInvalidURI() { $this->assertResult( 'Google', 'Google' ); } function testBdoAddMissingDir() { $this->assertResult( 'Go left.', 'Go left.' ); } function testBdoReplaceInvalidDirWithDefault() { $this->assertResult( 'Invalid value!', 'Invalid value!' ); } function testBdoAlternateDefaultDir() { $this->config->set('Attr.DefaultTextDir', 'rtl'); $this->assertResult( 'Go right.', 'Go right.' ); } function testRemoveDirWhenNotRequired() { $this->assertResult( 'Invalid value!', 'Invalid value!' ); } function testTableAttributes() { $this->assertResult( '
Fiddly name Super-duper-price
Carrot Humungous $500.23
Taken off the market
' ); } function testColSpanIsNonZero() { $this->assertResult( '', '' ); } function testImgAddDefaults() { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( '', 'Invalid image' ); } function testImgGenerateAlt() { $this->assertResult( '', 'foobar.jpg' ); } function testImgAddDefaultSrc() { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( 'pretty picture', 'pretty picture' ); } function testImgRemoveNonRetrievableProtocol() { $this->config->set('Core.RemoveInvalidImg', false); $this->assertResult( '', 'mailto:foo@example.com' ); } function testPreserveRel() { $this->config->set('Attr.AllowedRel', 'nofollow'); $this->assertResult(''); } function testPreserveTarget() { $this->config->set('Attr.AllowedFrameTargets', '_top'); $this->config->set('HTML.Doctype', 'XHTML 1.0 Transitional'); $this->assertResult(''); } function testRemoveTargetWhenNotSupported() { $this->config->set('HTML.Doctype', 'XHTML 1.0 Strict'); $this->config->set('Attr.AllowedFrameTargets', '_top'); $this->assertResult( '', '' ); } function testKeepAbsoluteCSSWidthAndHeightOnImg() { $this->assertResult( '' ); } function testRemoveLargeCSSWidthAndHeightOnImg() { $this->assertResult( '', '' ); } function testRemoveLargeCSSWidthAndHeightOnImgWithUserConf() { $this->config->set('CSS.MaxImgLength', '1px'); $this->assertResult( '', '' ); } function testKeepLargeCSSWidthAndHeightOnImgWhenToldTo() { $this->config->set('CSS.MaxImgLength', null); $this->assertResult( '' ); } function testKeepPercentCSSWidthAndHeightOnImgWhenToldTo() { $this->config->set('CSS.MaxImgLength', null); $this->assertResult( '' ); } function testRemoveRelativeCSSWidthAndHeightOnImg() { $this->assertResult( '', '' ); } function testRemovePercentCSSWidthAndHeightOnImg() { $this->assertResult( '', '' ); } } // vim: et sw=4 sts=4