Prepended constants with C_ to avoid reserved words as per https://www.php.net/manual...
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / AttrTransform / BackgroundTest.php
blobbc397fcd0c9935ddefe9cf6de95074cfde4e56f7
1 <?php
3 class HTMLPurifier_AttrTransform_BackgroundTest extends HTMLPurifier_AttrTransformHarness
6 public function setUp()
8 parent::setUp();
9 $this->obj = new HTMLPurifier_AttrTransform_Background();
12 public function testEmptyInput()
14 $this->assertResult( array() );
17 public function testBasicTransform()
19 $this->assertResult(
20 array('background' => 'logo.png'),
21 array('style' => 'background-image:url(logo.png);')
25 public function testPrependNewCSS()
27 $this->assertResult(
28 array('background' => 'logo.png', 'style' => 'font-weight:bold'),
29 array('style' => 'background-image:url(logo.png);font-weight:bold')
33 public function testLenientTreatmentOfInvalidInput()
35 // notice that we rely on the CSS validator later to fix this invalid
36 // stuff
37 $this->assertResult(
38 array('background' => 'logo.png);foo:('),
39 array('style' => 'background-image:url(logo.png);foo:();')
45 // vim: et sw=4 sts=4