3 require_once 'HTMLPurifier/AttrDef/CSSLength.php';
4 require_once 'HTMLPurifier/AttrDefHarness.php';
6 class HTMLPurifier_AttrDef_CSSLengthTest
extends HTMLPurifier_AttrDefHarness
11 $this->def
= new HTMLPurifier_AttrDef_CSSLength();
13 $this->assertDef('0');
14 $this->assertDef('0px');
15 $this->assertDef('4.5px');
16 $this->assertDef('-4.5px');
17 $this->assertDef('3ex');
18 $this->assertDef('3em');
19 $this->assertDef('3in');
20 $this->assertDef('3cm');
21 $this->assertDef('3mm');
22 $this->assertDef('3pt');
23 $this->assertDef('3pc');
25 $this->assertDef('3', false);
26 $this->assertDef('3miles', false);
30 function testNonNegative() {
32 $this->def
= new HTMLPurifier_AttrDef_CSSLength(true);
34 $this->assertDef('3cm');
35 $this->assertDef('-3mm', false);