2007-03-29 23:19:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/AttrTransform/Name.php';
|
|
|
|
require_once 'HTMLPurifier/AttrTransformHarness.php';
|
|
|
|
|
|
|
|
class HTMLPurifier_AttrTransform_NameTest extends HTMLPurifier_AttrTransformHarness
|
|
|
|
{
|
|
|
|
|
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_AttrTransform_Name();
|
|
|
|
}
|
|
|
|
|
2007-08-06 06:22:23 +00:00
|
|
|
function testEmpty() {
|
2007-03-29 23:19:53 +00:00
|
|
|
$this->assertResult( array() );
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testTransformNameToID() {
|
2007-03-29 23:19:53 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('name' => 'free'),
|
|
|
|
array('id' => 'free')
|
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testExistingIDOverridesName() {
|
2007-03-29 23:19:53 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('name' => 'tryit', 'id' => 'tobad'),
|
|
|
|
array('id' => 'tobad')
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|