Fix two minor bugs, updating Phorum and removing unused $dir variable.
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / IDAccumulatorTest.php
blob90bca073909938ed35550fdf70d40281e9193c35
1 <?php
3 class HTMLPurifier_IDAccumulatorTest extends HTMLPurifier_Harness
6 function test() {
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']) );
20 function testLoad() {
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']) );
39 // vim: et sw=4 sts=4