3 class HTMLPurifier_AttrDef_CSS_LengthTest
extends HTMLPurifier_AttrDefHarness
8 $this->def
= new HTMLPurifier_AttrDef_CSS_Length();
10 $this->assertDef('0');
11 $this->assertDef('0px');
12 $this->assertDef('4.5px');
13 $this->assertDef('-4.5px');
14 $this->assertDef('3ex');
15 $this->assertDef('3em');
16 $this->assertDef('3in');
17 $this->assertDef('3cm');
18 $this->assertDef('3mm');
19 $this->assertDef('3pt');
20 $this->assertDef('3pc');
22 $this->assertDef('3PX', '3px');
24 $this->assertDef('3', false);
25 $this->assertDef('3miles', false);
29 public function testNonNegative()
31 $this->def
= new HTMLPurifier_AttrDef_CSS_Length('0');
33 $this->assertDef('3cm');
34 $this->assertDef('-3mm', false);
38 public function testBounding()
40 $this->def
= new HTMLPurifier_AttrDef_CSS_Length('-1in', '1in');
41 $this->assertDef('1cm');
42 $this->assertDef('-1cm');
43 $this->assertDef('0');
44 $this->assertDef('1em', false);