Release 2.0.1, merged in 1181 to HEAD.
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / LengthTest.php
blob62068e4bb681b4b768a729a4aeaa875abf7938ec
1 <?php
3 require_once 'HTMLPurifier/AttrTransform/Length.php';
4 require_once 'HTMLPurifier/AttrTransformHarness.php';
6 class HTMLPurifier_AttrTransform_LengthTest extends HTMLPurifier_AttrTransformHarness
9 function setUp() {
10 parent::setUp();
11 $this->obj = new HTMLPurifier_AttrTransform_Length('width');
14 function test() {
15 $this->assertResult( array() );
16 $this->assertResult(
17 array('width' => '10'),
18 array('style' => 'width:10px;')
20 $this->assertResult(
21 array('width' => '10%'),
22 array('style' => 'width:10%;')
24 $this->assertResult(
25 array('width' => '10%', 'style' => 'font-weight:bold'),
26 array('style' => 'width:10%;font-weight:bold')
28 // this behavior might change
29 $this->assertResult(
30 array('width' => 'asdf'),
31 array('style' => 'width:asdf;')