Fix #67, don't use <body> tags in comments for %Core.ConvertDocumentToFragment
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / EnumToCSSTest.php
blobe895e129e6b8a202692203c46d703e814916c85a
1 <?php
3 class HTMLPurifier_AttrTransform_EnumToCSSTest extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
8 parent::setUp();
9 $this->obj = new HTMLPurifier_AttrTransform_EnumToCSS('align', array(
10 'left' => 'text-align:left;',
11 'right' => 'text-align:right;'
12 ));
15 public function testEmptyInput()
17 $this->assertResult( array() );
20 public function testPreserveArraysWithoutInterestingAttributes()
22 $this->assertResult( array('style' => 'font-weight:bold;') );
25 public function testConvertAlignLeft()
27 $this->assertResult(
28 array('align' => 'left'),
29 array('style' => 'text-align:left;')
33 public function testConvertAlignRight()
35 $this->assertResult(
36 array('align' => 'right'),
37 array('style' => 'text-align:right;')
41 public function testRemoveInvalidAlign()
43 $this->assertResult(
44 array('align' => 'invalid'),
45 array()
49 public function testPrependNewCSS()
51 $this->assertResult(
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;'
62 ));
63 $this->assertResult(
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;'
73 ), true);
74 $this->assertResult(
75 array('align' => 'RIGHT'),
76 array()
82 // vim: et sw=4 sts=4