Fix autoparagraph bug with non-inline elements.
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / ImgSpaceTest.php
blob42e8738e4c1c64f4d61d2e324a6801e8b322ed49
1 <?php
3 class HTMLPurifier_AttrTransform_ImgSpaceTest extends HTMLPurifier_AttrTransformHarness
6 function setUp() {
7 parent::setUp();
8 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('vspace');
11 function testEmptyInput() {
12 $this->assertResult( array() );
15 function testVerticalBasicUsage() {
16 $this->assertResult(
17 array('vspace' => '1'),
18 array('style' => 'margin-top:1px;margin-bottom:1px;')
22 function testLenientHandlingOfInvalidInput() {
23 $this->assertResult(
24 array('vspace' => '10%'),
25 array('style' => 'margin-top:10%px;margin-bottom:10%px;')
29 function testPrependNewCSS() {
30 $this->assertResult(
31 array('vspace' => '23', 'style' => 'font-weight:bold;'),
32 array('style' => 'margin-top:23px;margin-bottom:23px;font-weight:bold;')
36 function testHorizontalBasicUsage() {
37 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('hspace');
38 $this->assertResult(
39 array('hspace' => '1'),
40 array('style' => 'margin-left:1px;margin-right:1px;')
44 function testInvalidConstructionParameter() {
45 $this->expectError('ispace is not valid space attribute');
46 $this->obj = new HTMLPurifier_AttrTransform_ImgSpace('ispace');
47 $this->assertResult(
48 array('ispace' => '1'),
49 array()
55 // vim: et sw=4 sts=4