2007-03-29 23:19:53 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_AttrTransform_NameTest extends HTMLPurifier_AttrTransformHarness
|
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
2007-03-29 23:19:53 +00:00
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_AttrTransform_Name();
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testEmpty()
|
|
|
|
{
|
2007-03-29 23:19:53 +00:00
|
|
|
$this->assertResult( array() );
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public 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
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testExistingIDOverridesName()
|
|
|
|
{
|
2007-03-29 23:19:53 +00:00
|
|
|
$this->assertResult(
|
|
|
|
array('name' => 'tryit', 'id' => 'tobad'),
|
|
|
|
array('id' => 'tobad')
|
|
|
|
);
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2007-03-29 23:19:53 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|