3 require_once 'HTMLPurifier/AttrDefHarness.php';
4 require_once 'HTMLPurifier/AttrDef/HTML/Pixels.php';
6 class HTMLPurifier_AttrDef_HTML_PixelsTest
extends HTMLPurifier_AttrDefHarness
10 $this->def
= new HTMLPurifier_AttrDef_HTML_Pixels();
15 $this->assertDef('1');
16 $this->assertDef('0');
18 $this->assertDef('2px', '2'); // rm px suffix
20 $this->assertDef('dfs', false); // totally invalid value
22 // conceivably we could repair this value, but we won't for now
23 $this->assertDef('9in', false);
26 $this->assertDef(' 45 ', '45');
29 $this->assertDef('-2', '0');
32 $this->assertDef('', false);
35 $this->assertDef('4.9', '4');