Whoops, forgot to edit WHATSNEW
[htmlpurifier.git] / tests / HTMLPurifier / AttrTransformTest.php
blobe2aeac765b971ba0a1191abd487305ea1b3545f3
1 <?php
3 Mock::generatePartial(
4 'HTMLPurifier_AttrTransform',
5 'HTMLPurifier_AttrTransformTestable',
6 array('transform'));
8 class HTMLPurifier_AttrTransformTest extends HTMLPurifier_Harness
11 public 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 public 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