diff options
Diffstat (limited to 'lib/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php')
-rw-r--r-- | lib/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php b/lib/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php new file mode 100644 index 000000000..10e121238 --- /dev/null +++ b/lib/htmlpurifier/tests/HTMLPurifier/AttrTransform/NameTest.php @@ -0,0 +1,31 @@ +<?php + +class HTMLPurifier_AttrTransform_NameTest extends HTMLPurifier_AttrTransformHarness +{ + + function setUp() { + parent::setUp(); + $this->obj = new HTMLPurifier_AttrTransform_Name(); + } + + function testEmpty() { + $this->assertResult( array() ); + } + + function testTransformNameToID() { + $this->assertResult( + array('name' => 'free'), + array('id' => 'free') + ); + } + + function testExistingIDOverridesName() { + $this->assertResult( + array('name' => 'tryit', 'id' => 'tobad'), + array('id' => 'tobad') + ); + } + +} + +// vim: et sw=4 sts=4 |