home
/
zktecojo
/
public_html
/
htmlpurifier
/
tests
/
HTMLPurifier
➕ New
📤 Upload
✎ Editing:
AttrTransformTest.php
← Back
<?php Mock::generatePartial( 'HTMLPurifier_AttrTransform', 'HTMLPurifier_AttrTransformTestable', array('transform')); class HTMLPurifier_AttrTransformTest extends HTMLPurifier_Harness { public function test_prependCSS() { $t = new HTMLPurifier_AttrTransformTestable(); $attr = array(); $t->prependCSS($attr, 'style:new;'); $this->assertIdentical(array('style' => 'style:new;'), $attr); $attr = array('style' => 'style:original;'); $t->prependCSS($attr, 'style:new;'); $this->assertIdentical(array('style' => 'style:new;style:original;'), $attr); $attr = array('style' => 'style:original;', 'misc' => 'un-related'); $t->prependCSS($attr, 'style:new;'); $this->assertIdentical(array('style' => 'style:new;style:original;', 'misc' => 'un-related'), $attr); } public function test_confiscateAttr() { $t = new HTMLPurifier_AttrTransformTestable(); $attr = array('flavor' => 'sweet'); $this->assertIdentical('sweet', $t->confiscateAttr($attr, 'flavor')); $this->assertIdentical(array(), $attr); $attr = array('flavor' => 'sweet'); $this->assertIdentical(null, $t->confiscateAttr($attr, 'color')); $this->assertIdentical(array('flavor' => 'sweet'), $attr); } } // vim: et sw=4 sts=4
💾 Save Changes
Cancel
📤 Upload File
×
Select File
Upload
Cancel
➕ Create New
×
Type
📄 File
📁 Folder
Name
Create
Cancel
✎ Rename Item
×
Current Name
New Name
Rename
Cancel
🔐 Change Permissions
×
Target File
Permission (e.g., 0755, 0644)
0755
0644
0777
Apply
Cancel