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