Fix autoparagraph bug with non-inline elements.
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / BgColorTest.php
blob13567b74e929eb50846563ae609ee34225442803
1 <?php
3 // we currently rely on the CSS validator to fix any problems.
4 // This means that this transform, strictly speaking, supports
5 // a superset of the functionality.
7 class HTMLPurifier_AttrTransform_BgColorTest extends HTMLPurifier_AttrTransformHarness
10 function setUp() {
11 parent::setUp();
12 $this->obj = new HTMLPurifier_AttrTransform_BgColor();
15 function testEmptyInput() {
16 $this->assertResult( array() );
19 function testBasicTransform() {
20 $this->assertResult(
21 array('bgcolor' => '#000000'),
22 array('style' => 'background-color:#000000;')
26 function testPrependNewCSS() {
27 $this->assertResult(
28 array('bgcolor' => '#000000', 'style' => 'font-weight:bold'),
29 array('style' => 'background-color:#000000;font-weight:bold')
33 function testLenientTreatmentOfInvalidInput() {
34 // this may change when we natively support the datatype and
35 // validate its contents before forwarding it on
36 $this->assertResult(
37 array('bgcolor' => '#F00'),
38 array('style' => 'background-color:#F00;')
44 // vim: et sw=4 sts=4