Fix standards-compliance issue with YouTube filter with double hyphens.
[htmlpurifier/bfroehle.git] / tests / HTMLPurifier / IDAccumulatorTest.php
blobc748845fc78044f7ea8f2c814f3430388906f098
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