mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-01 11:50:28 +02:00
Generalize IDAccumulator into AttrContext. Modify tests and classes accordingly. Also, this allows us to make the validate() parameters uniform among all AttrDef subclasses.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@212 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -4,14 +4,15 @@ class HTMLPurifier_AttrDefHarness extends UnitTestCase
|
||||
{
|
||||
|
||||
var $def;
|
||||
var $id_accumulator;
|
||||
var $context;
|
||||
var $config;
|
||||
|
||||
// cannot be used for accumulator
|
||||
function assertDef($string, $expect = true) {
|
||||
// $expect can be a string or bool
|
||||
if (!$this->config) $this->config = HTMLPurifier_Config::createDefault();
|
||||
$result = $this->def->validate($string, $this->config, $this->id_accumulator);
|
||||
if (!$this->context) $this->context = new HTMLPurifier_AttrContext();
|
||||
$result = $this->def->validate($string, $this->config, $this->context);
|
||||
if ($expect === true) {
|
||||
$this->assertIdentical($string, $result);
|
||||
} else {
|
||||
|
Reference in New Issue
Block a user