PSR-2 reformatting PHPDoc corrections
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / ImgSpaceTest.php
blob9240f09a6dc780c9d0787bbdbbb0bb5d853b75df
1 <?php
3 class HTMLPurifier_AttrTransform_ImgSpaceTest extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
8 parent::setUp();
9 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('vspace');
12 public function testEmptyInput()
14 $this->assertResult( array() );
17 public function testVerticalBasicUsage()
19 $this->assertResult(
20 array('vspace' => '1'),
21 array('style' => 'margin-top:1px;margin-bottom:1px;')
25 public function testLenientHandlingOfInvalidInput()
27 $this->assertResult(
28 array('vspace' => '10%'),
29 array('style' => 'margin-top:10%px;margin-bottom:10%px;')
33 public function testPrependNewCSS()
35 $this->assertResult(
36 array('vspace' => '23', 'style' => 'font-weight:bold;'),
37 array('style' => 'margin-top:23px;margin-bottom:23px;font-weight:bold;')
41 public function testHorizontalBasicUsage()
43 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('hspace');
44 $this->assertResult(
45 array('hspace' => '1'),
46 array('style' => 'margin-left:1px;margin-right:1px;')
50 public function testInvalidConstructionParameter()
52 $this->expectError('ispace is not valid space attribute');
53 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('ispace');
54 $this->assertResult(
55 array('ispace' => '1'),
56 array()
62 // vim: et sw=4 sts=4