3 class HTMLPurifier_AttrDef_CSS_NumberTest
extends HTMLPurifier_AttrDefHarness
8 $this->def
= new HTMLPurifier_AttrDef_CSS_Number();
10 $this->assertDef('0');
11 $this->assertDef('0.0', '0');
12 $this->assertDef('1.0', '1');
13 $this->assertDef('34');
14 $this->assertDef('4.5');
15 $this->assertDef('.5');
16 $this->assertDef('0.5', '.5');
17 $this->assertDef('-56.9');
19 $this->assertDef('0.', '0');
20 $this->assertDef('.0', '0');
21 $this->assertDef('0.0', '0');
23 $this->assertDef('1.', '1');
24 $this->assertDef('.1', '.1');
26 $this->assertDef('1.0', '1');
27 $this->assertDef('0.1', '.1');
29 $this->assertDef('000', '0');
30 $this->assertDef(' 9', '9');
31 $this->assertDef('+5.0000', '5');
32 $this->assertDef('02.20', '2.2');
33 $this->assertDef('2.', '2');
35 $this->assertDef('.', false);
36 $this->assertDef('asdf', false);
37 $this->assertDef('0.5.6', false);
41 function testNonNegative() {
43 $this->def
= new HTMLPurifier_AttrDef_CSS_Number(true);
44 $this->assertDef('23');
45 $this->assertDef('-12', false);