3 require_once 'HTMLPurifier/AttrTransform/ImgSpace.php';
4 require_once 'HTMLPurifier/AttrTransformHarness.php';
7 class HTMLPurifier_AttrTransform_ImgSpaceTest
extends HTMLPurifier_AttrTransformHarness
14 function testVertical() {
16 $this->obj
= new HTMLPurifier_AttrTransform_ImgSpace('vspace');
18 $this->assertResult( array() );
21 array('vspace' => '1'),
22 array('style' => 'margin-top:1px;margin-bottom:1px;')
25 // no validation done here, we expect CSS validator to catch it
27 array('vspace' => '10%'),
28 array('style' => 'margin-top:10%px;margin-bottom:10%px;')
32 array('vspace' => '23', 'style' => 'font-weight:bold;'),
33 array('style' => 'margin-top:23px;margin-bottom:23px;font-weight:bold;')
38 function testHorizontal() {
39 $this->obj
= new HTMLPurifier_AttrTransform_ImgSpace('hspace');
41 array('hspace' => '1'),
42 array('style' => 'margin-left:1px;margin-right:1px;')
46 function testInvalid() {
47 $this->expectError('ispace is not valid space attribute');
48 $this->obj
= new HTMLPurifier_AttrTransform_ImgSpace('ispace');
50 array('ispace' => '1'),