1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-10 09:16:20 +02:00

[1.7.0] Implement addAttribute() of advanced API.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1164 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2007-06-19 01:29:50 +00:00
parent c3094275ef
commit 6aa3dfc116
3 changed files with 49 additions and 1 deletions

View File

@ -52,6 +52,23 @@ class HTMLPurifier_HTMLDefinitionTest extends UnitTestCase
}
function test_addAttribute() {
$config = HTMLPurifier_Config::create(array(
'HTML.DefinitionID' => 'HTMLPurifier_HTMLDefinitionTest->test_addAttribute'
));
$config->revision = 9;
$def =& $config->getHTMLDefinition(true);
$def->addAttribute('span', 'custom', 'Enum#attribute');
$def = $config->getHTMLDefinition();
$purifier = new HTMLPurifier($config);
$input = '<span custom="attribute">Custom!</span>';
$output = $purifier->purify($input);
$this->assertIdentical($input, $output);
}
}
?>