obj = new HTMLPurifier_Strategy_RemoveForeignElements();
}
function testBlankInput() {
$this->assertResult('');
}
function testPreserveRecognizedElements() {
$this->assertResult('This is bold text.');
}
function testRemoveForeignElements() {
$this->assertResult(
'BlingBong',
'BlingBong'
);
}
function testRemoveScriptAndContents() {
$this->assertResult(
'',
''
);
}
function testRemoveStyleAndContents() {
$this->assertResult(
'',
''
);
}
function testRemoveOnlyScriptTagsLegacy() {
$this->config->set('Core', 'RemoveScriptContents', false);
$this->assertResult(
'',
'alert();'
);
}
function testRemoveOnlyScriptTags() {
$this->config->set('Core', 'HiddenElements', array());
$this->assertResult(
'',
'alert();'
);
}
function testRemoveInvalidImg() {
$this->assertResult('', '');
}
function testPreserveValidImg() {
$this->assertResult('');
}
function testPreserveInvalidImgWhenRemovalIsDisabled() {
$this->config->set('Core', 'RemoveInvalidImg', false);
$this->assertResult('');
}
function testTextifyCommentedScriptContents() {
$this->config->set('HTML', 'Trusted', true);
$this->config->set('Output', 'CommentScriptContents', false); // simplify output
$this->assertResult(
'',
''
);
}
}