1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-13 18:46:34 +02:00

[2.1.4] [MFH] addAttribute() can be called multiple times, from r1634

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/php4@1717 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2008-05-15 05:13:11 +00:00
parent 957a840f54
commit 9f23bc005b
3 changed files with 30 additions and 1 deletions

View File

@ -87,6 +87,22 @@ a[href|title]
}
function test_addAttribute_multiple() {
$config = HTMLPurifier_Config::create(array(
'HTML.DefinitionID' => 'HTMLPurifier_HTMLDefinitionTest->test_addAttribute_multiple'
));
$def =& $config->getHTMLDefinition(true);
$def->addAttribute('span', 'custom', 'Enum#attribute');
$def->addAttribute('span', 'foo', 'Text');
$purifier = new HTMLPurifier($config);
$input = '<span custom="attribute" foo="asdf">Custom!</span>';
$output = $purifier->purify($input);
$this->assertIdentical($input, $output);
}
function test_addElement() {
$config = HTMLPurifier_Config::create(array(