3 class HTMLPurifier_IDAccumulatorTest
extends HTMLPurifier_Harness
8 // initialize the accumulator
9 $accumulator = new HTMLPurifier_IDAccumulator();
11 $this->assertTrue( $accumulator->add('id1'));
12 $this->assertTrue( $accumulator->add('id2'));
13 $this->assertFalse($accumulator->add('id1')); // repeated id
15 // you can also access the properties (they're public)
16 $this->assertTrue( isset($accumulator->ids
['id2']) );
22 $accumulator = new HTMLPurifier_IDAccumulator();
24 $accumulator->load(array('id1', 'id2', 'id3'));
26 $this->assertFalse($accumulator->add('id1')); // repeated id
27 $this->assertTrue($accumulator->add('id4'));
31 function testBuild() {
32 $this->config
->set('Attr', 'IDBlacklist', array('foo'));
33 $accumulator = HTMLPurifier_IDAccumulator
::build($this->config
, $this->context
);
34 $this->assertTrue( isset($accumulator->ids
['foo']) );