3 class HTMLPurifier_AttrTransform_ImgSpaceTest
extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
9 $this->obj
= new HTMLPurifier_AttrTransform_ImgSpace('vspace');
12 public function testEmptyInput()
14 $this->assertResult( array() );
17 public function testVerticalBasicUsage()
20 array('vspace' => '1'),
21 array('style' => 'margin-top:1px;margin-bottom:1px;')
25 public function testLenientHandlingOfInvalidInput()
28 array('vspace' => '10%'),
29 array('style' => 'margin-top:10%px;margin-bottom:10%px;')
33 public function testPrependNewCSS()
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');
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');
55 array('ispace' => '1'),