PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / AttrDef / CSS / BackgroundPositionTest.php
blob61952d660486edba3c9120bdde205b3eb36c434f
1 <?php
3 class HTMLPurifier_AttrDef_CSS_BackgroundPositionTest extends HTMLPurifier_AttrDefHarness
6 public function test()
8 $this->def = new HTMLPurifier_AttrDef_CSS_BackgroundPosition();
10 // explicitly cited in spec
11 $this->assertDef('0% 0%');
12 $this->assertDef('100% 100%');
13 $this->assertDef('14% 84%');
14 $this->assertDef('2cm 1cm');
15 $this->assertDef('top');
16 $this->assertDef('left');
17 $this->assertDef('center');
18 $this->assertDef('right');
19 $this->assertDef('bottom');
20 $this->assertDef('left top');
21 $this->assertDef('center top');
22 $this->assertDef('right top');
23 $this->assertDef('left center');
24 $this->assertDef('right center');
25 $this->assertDef('left bottom');
26 $this->assertDef('center bottom');
27 $this->assertDef('right bottom');
29 // reordered due to internal impl details
30 $this->assertDef('top left', 'left top');
31 $this->assertDef('top center', 'top');
32 $this->assertDef('top right', 'right top');
33 $this->assertDef('center left', 'left');
34 $this->assertDef('center center', 'center');
35 $this->assertDef('center right', 'right');
36 $this->assertDef('bottom left', 'left bottom');
37 $this->assertDef('bottom center', 'bottom');
38 $this->assertDef('bottom right', 'right bottom');
40 // more cases from the defined syntax
41 $this->assertDef('1.32in 4ex');
42 $this->assertDef('-14% -84.65%');
43 $this->assertDef('-1in -4ex');
44 $this->assertDef('-1pc 2.3%');
46 // keyword mixing
47 $this->assertDef('3em top');
48 $this->assertDef('left 50%');
50 // fixable keyword mixing
51 $this->assertDef('top 3em', '3em top');
52 $this->assertDef('50% left', 'left 50%');
54 // whitespace collapsing
55 $this->assertDef('3em top', '3em top');
56 $this->assertDef("left\n \t foo ", 'left');
58 // invalid uses (we're going to be strict on these)
59 $this->assertDef('foo bar', false);
60 $this->assertDef('left left', 'left');
61 $this->assertDef('left right top bottom center left', 'left bottom');
62 $this->assertDef('0fr 9%', '9%');
68 // vim: et sw=4 sts=4