Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / AttrTransform / NameSyncTest.php
blob989b0ee84fcca7f0cd691886d1f889520cc7e297
1 <?php
3 class HTMLPurifier_AttrTransform_NameSyncTest extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
8 parent::setUp();
9 $this->obj = new HTMLPurifier_AttrTransform_NameSync();
10 $this->accumulator = new HTMLPurifier_IDAccumulator();
11 $this->context->register('IDAccumulator', $this->accumulator);
12 $this->config->set('Attr.EnableID', true);
15 public function testEmpty()
17 $this->assertResult( array() );
20 public function testAllowSame()
22 $this->assertResult(
23 array('name' => 'free', 'id' => 'free')
27 public function testAllowDifferent()
29 $this->assertResult(
30 array('name' => 'tryit', 'id' => 'thisgood')
34 public function testCheckName()
36 $this->accumulator->add('notok');
37 $this->assertResult(
38 array('name' => 'notok', 'id' => 'ok'),
39 array('id' => 'ok')
45 // vim: et sw=4 sts=4