Release 2.0.1, merged in 1181 to HEAD.
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / BgColorTest.php
blob69429ad8d661d5bc9454150923b2ce373d1085c4
1 <?php
3 require_once 'HTMLPurifier/AttrTransform/BgColor.php';
4 require_once 'HTMLPurifier/AttrTransformHarness.php';
6 class HTMLPurifier_AttrTransform_BgColorTest extends HTMLPurifier_AttrTransformHarness
9 function setUp() {
10 parent::setUp();
11 $this->obj = new HTMLPurifier_AttrTransform_BgColor();
14 function test() {
16 $this->assertResult( array() );
18 // we currently rely on the CSS validator to fix any problems.
19 // This means that this transform, strictly speaking, supports
20 // a superset of the functionality.
22 $this->assertResult(
23 array('bgcolor' => '#000000'),
24 array('style' => 'background-color:#000000;')
27 $this->assertResult(
28 array('bgcolor' => '#000000', 'style' => 'font-weight:bold'),
29 array('style' => 'background-color:#000000;font-weight:bold')
32 // this may change when we natively support the datatype and
33 // validate its contents before forwarding it on
34 $this->assertResult(
35 array('bgcolor' => '#F00'),
36 array('style' => 'background-color:#F00;')