1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 21:57:26 +02:00

Fix case-sensitivity issues for attributes. Added TokenTest. Updated TODO. Removed TagTransform::normalizeAttributes

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@142 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-02 02:43:52 +00:00
parent 145a51da5a
commit 80281dda55
6 changed files with 53 additions and 34 deletions

View File

@@ -0,0 +1,36 @@
<?php
require_once 'HTMLPurifier/Token.php';
class HTMLPurifier_TokenTest extends UnitTestCase
{
function assertTokenConstruction($name, $attributes,
$expect_name = null, $expect_attributes = null
) {
if ($expect_name === null) $expect_name = $name;
if ($expect_attributes === null) $expect_attributes = $attributes;
$token = new HTMLPurifier_Token_Start($name, $attributes);
$this->assertEqual($expect_name, $token->name);
$this->assertEqual($expect_attributes, $token->attributes);
}
function testConstruct() {
// standard case
$this->assertTokenConstruction('a', array('href' => 'about:blank'));
// lowercase the tag's name
$this->assertTokenConstruction('A', array('href' => 'about:blank'),
'a');
// lowercase attributes
$this->assertTokenConstruction('a', array('HREF' => 'about:blank'),
'a', array('href' => 'about:blank'));
}
}
?>