mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-05 13:47:24 +02:00
Add tests for new entity decoding codepath.
Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
This commit is contained in:
@@ -16,8 +16,12 @@ class HTMLPurifier_EntityParserTest extends HTMLPurifier_Harness
|
||||
$char_theta = $this->_entity_lookup->table['theta'];
|
||||
$this->assertIdentical($char_theta,
|
||||
$this->EntityParser->substituteNonSpecialEntities('θ') );
|
||||
$this->assertIdentical($char_theta,
|
||||
$this->EntityParser->substituteTextEntities('θ') );
|
||||
$this->assertIdentical('"',
|
||||
$this->EntityParser->substituteNonSpecialEntities('"') );
|
||||
$this->assertIdentical('"',
|
||||
$this->EntityParser->substituteTextEntities('"') );
|
||||
|
||||
// numeric tests, adapted from Feyd
|
||||
$args = array();
|
||||
@@ -71,6 +75,11 @@ class HTMLPurifier_EntityParserTest extends HTMLPurifier_Harness
|
||||
$expect,
|
||||
'Identical expectation [Hex: '. dechex($arg[0]) .']'
|
||||
);
|
||||
$this->assertIdentical(
|
||||
$this->EntityParser->substituteTextEntities($string),
|
||||
$expect,
|
||||
'Identical expectation [Hex: '. dechex($arg[0]) .']'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -81,6 +90,10 @@ class HTMLPurifier_EntityParserTest extends HTMLPurifier_Harness
|
||||
"'",
|
||||
$this->EntityParser->substituteSpecialEntities(''')
|
||||
);
|
||||
$this->assertIdentical(
|
||||
"'",
|
||||
$this->EntityParser->substituteTextEntities(''')
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user