Rewrite CSS url() and font-family output logic.
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransformTest.php
blob71a788580d6da3356ed747954e45c59d97cd9ed7
1 <?php
3 Mock::generatePartial(
4 'HTMLPurifier_AttrTransform',
5 'HTMLPurifier_AttrTransformTestable',
6 array('transform'));
8 class HTMLPurifier_AttrTransformTest extends HTMLPurifier_Harness
11 function test_prependCSS() {
13 $t = new HTMLPurifier_AttrTransformTestable();
15 $attr = array();
16 $t->prependCSS($attr, 'style:new;');
17 $this->assertIdentical(array('style' => 'style:new;'), $attr);
19 $attr = array('style' => 'style:original;');
20 $t->prependCSS($attr, 'style:new;');
21 $this->assertIdentical(array('style' => 'style:new;style:original;'), $attr);
23 $attr = array('style' => 'style:original;', 'misc' => 'un-related');
24 $t->prependCSS($attr, 'style:new;');
25 $this->assertIdentical(array('style' => 'style:new;style:original;', 'misc' => 'un-related'), $attr);
29 function test_confiscateAttr() {
31 $t = new HTMLPurifier_AttrTransformTestable();
33 $attr = array('flavor' => 'sweet');
34 $this->assertIdentical('sweet', $t->confiscateAttr($attr, 'flavor'));
35 $this->assertIdentical(array(), $attr);
37 $attr = array('flavor' => 'sweet');
38 $this->assertIdentical(null, $t->confiscateAttr($attr, 'color'));
39 $this->assertIdentical(array('flavor' => 'sweet'), $attr);
45 // vim: et sw=4 sts=4