Whoops, forgot to edit WHATSNEW
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransform / BgColorTest.php
blob6c2b358a2f644f02fb0974ed95ef95e8e4b892a6
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 public function setUp()
12 parent::setUp();
13 $this->obj = new HTMLPurifier_AttrTransform_BgColor();
16 public function testEmptyInput()
18 $this->assertResult( array() );
21 public function testBasicTransform()
23 $this->assertResult(
24 array('bgcolor' => '#000000'),
25 array('style' => 'background-color:#000000;')
29 public function testPrependNewCSS()
31 $this->assertResult(
32 array('bgcolor' => '#000000', 'style' => 'font-weight:bold'),
33 array('style' => 'background-color:#000000;font-weight:bold')
37 public function testLenientTreatmentOfInvalidInput()
39 // this may change when we natively support the datatype and
40 // validate its contents before forwarding it on
41 $this->assertResult(
42 array('bgcolor' => '#F00'),
43 array('style' => 'background-color:#F00;')
49 // vim: et sw=4 sts=4