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->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(
'',
''
);
}
function testImgGenerateAlt() {
$this->assertResult(
'',
''
);
}
function testImgAddDefaultSrc() {
$this->config->set('Core', 'RemoveInvalidImg', false);
$this->assertResult(
'',
''
);
}
function testImgRemoveNonRetrievableProtocol() {
$this->config->set('Core', 'RemoveInvalidImg', false);
$this->assertResult(
'',
''
);
}
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(
'',
''
);
}
}