PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / HTML / PixelsTest.php
blobc7f36772ddf46bbcd5ae3e46b7771f8cd0dc12b8
1 <?php
3 class HTMLPurifier_AttrDef_HTML_PixelsTest extends HTMLPurifier_AttrDefHarness
6 public function setup()
8 $this->def = new HTMLPurifier_AttrDef_HTML_Pixels();
11 public function test()
13 $this->assertDef('1');
14 $this->assertDef('0');
16 $this->assertDef('2px', '2'); // rm px suffix
18 $this->assertDef('dfs', false); // totally invalid value
20 // conceivably we could repair this value, but we won't for now
21 $this->assertDef('9in', false);
23 // test trim
24 $this->assertDef(' 45 ', '45');
26 // no negatives
27 $this->assertDef('-2', '0');
29 // remove empty
30 $this->assertDef('', false);
32 // round down
33 $this->assertDef('4.9', '4');
37 public function test_make()
39 $factory = new HTMLPurifier_AttrDef_HTML_Pixels();
40 $this->def = $factory->make('30');
41 $this->assertDef('25');
42 $this->assertDef('35', '30');
47 // vim: et sw=4 sts=4