mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-11-08 23:08:42 +00:00
058f1eba7d
- Also, enabled 'height' CSS attribute git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@922 48356398-32a2-884e-a903-53898d9a118a
37 lines
982 B
PHP
37 lines
982 B
PHP
<?php
|
|
|
|
require_once 'HTMLPurifier/AttrTransform/Length.php';
|
|
require_once 'HTMLPurifier/AttrTransformHarness.php';
|
|
|
|
class HTMLPurifier_AttrTransform_LengthTest extends HTMLPurifier_AttrTransformHarness
|
|
{
|
|
|
|
function setUp() {
|
|
parent::setUp();
|
|
$this->obj = new HTMLPurifier_AttrTransform_Length('width');
|
|
}
|
|
|
|
function test() {
|
|
$this->assertResult( array() );
|
|
$this->assertResult(
|
|
array('width' => '10'),
|
|
array('style' => 'width:10px;')
|
|
);
|
|
$this->assertResult(
|
|
array('width' => '10%'),
|
|
array('style' => 'width:10%;')
|
|
);
|
|
$this->assertResult(
|
|
array('width' => '10%', 'style' => 'font-weight:bold'),
|
|
array('style' => 'width:10%;font-weight:bold')
|
|
);
|
|
// this behavior might change
|
|
$this->assertResult(
|
|
array('width' => 'asdf'),
|
|
array('style' => 'width:asdf;')
|
|
);
|
|
}
|
|
|
|
}
|
|
|
|
?>
|