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

Merged revisions for 1.3.1 release into branch, with local modifications to keep NEWS items in present.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/branches/1.3@604 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-12-06 23:19:59 +00:00
parent d151ffd9e6
commit 3b979ee846
19 changed files with 149 additions and 72 deletions

View File

@@ -42,12 +42,15 @@ class HTMLPurifier_Strategy_RemoveForeignElementsTest
' Warning!</span>'
);
// test removal of img tag
// test removal of invalid img tag
$this->assertResult(
'<img />',
''
);
// test preservation of valid img tag
$this->assertResult('<img src="foobar.gif" />');
}
}

View File

@@ -5,15 +5,15 @@ require_once 'HTMLPurifier/Token.php';
class HTMLPurifier_TokenTest extends UnitTestCase
{
function assertTokenConstruction($name, $attributes,
$expect_name = null, $expect_attributes = null
function assertTokenConstruction($name, $attr,
$expect_name = null, $expect_attr = null
) {
if ($expect_name === null) $expect_name = $name;
if ($expect_attributes === null) $expect_attributes = $attributes;
$token = new HTMLPurifier_Token_Start($name, $attributes);
if ($expect_attr === null) $expect_attr = $attr;
$token = new HTMLPurifier_Token_Start($name, $attr);
$this->assertEqual($expect_name, $token->name);
$this->assertEqual($expect_attributes, $token->attributes);
$this->assertEqual($expect_name, $token->name);
$this->assertEqual($expect_attr, $token->attr);
}
function testConstruct() {