3 class HTMLPurifier_AttrTransform_EnumToCSSTest
extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
9 $this->obj
= new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
10 'left' => 'text-align:left;',
11 'right' => 'text-align:right;'
15 public function testEmptyInput()
17 $this->assertResult( array() );
20 public function testPreserveArraysWithoutInterestingAttributes()
22 $this->assertResult( array('style' => 'font-weight:bold;') );
25 public function testConvertAlignLeft()
28 array('align' => 'left'),
29 array('style' => 'text-align:left;')
33 public function testConvertAlignRight()
36 array('align' => 'right'),
37 array('style' => 'text-align:right;')
41 public function testRemoveInvalidAlign()
44 array('align' => 'invalid'),
49 public function testPrependNewCSS()
52 array('align' => 'left', 'style' => 'font-weight:bold;'),
53 array('style' => 'text-align:left;font-weight:bold;')
58 public function testCaseInsensitive()
60 $this->obj
= new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
61 'right' => 'text-align:right;'
64 array('align' => 'RIGHT'),
65 array('style' => 'text-align:right;')
69 public function testCaseSensitive()
71 $this->obj
= new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
72 'right' => 'text-align:right;'
75 array('align' => 'RIGHT'),