NameTest.php 647 B

12345678910111213141516171819202122232425262728293031
  1. <?php
  2. class HTMLPurifier_AttrTransform_NameTest extends HTMLPurifier_AttrTransformHarness
  3. {
  4. function setUp() {
  5. parent::setUp();
  6. $this->obj = new HTMLPurifier_AttrTransform_Name();
  7. }
  8. function testEmpty() {
  9. $this->assertResult( array() );
  10. }
  11. function testTransformNameToID() {
  12. $this->assertResult(
  13. array('name' => 'free'),
  14. array('id' => 'free')
  15. );
  16. }
  17. function testExistingIDOverridesName() {
  18. $this->assertResult(
  19. array('name' => 'tryit', 'id' => 'tobad'),
  20. array('id' => 'tobad')
  21. );
  22. }
  23. }
  24. // vim: et sw=4 sts=4