context = new HTMLPurifier_Context();
$id_accumulator = new HTMLPurifier_IDAccumulator();
$this->context->register('IDAccumulator', $id_accumulator);
$this->def = new HTMLPurifier_AttrDef_ID();
// valid ID names
$this->assertDef('alpha');
$this->assertDef('al_ha');
$this->assertDef('a0-:.');
$this->assertDef('a');
// invalid ID names
$this->assertDef('assertDef('0123', false);
$this->assertDef('.asa', false);
// test duplicate detection
$this->assertDef('a', false);
// valid once whitespace stripped, but needs to be amended
$this->assertDef(' whee ', 'whee');
}
}
?>