mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-06 14:16:32 +02:00
[1.7.0] Finish implementing legacy elements, begin implementing legacy attributes
- Migrated most unit tests over to XHTML 1.0 Strict to preserve transformation behavior - Created %Core.ColorKeywords to be shared between CSS_Color and HTML_Color - Added AttrDef_HTML_Color as AttrType Color - HTMLPurifier_Config::create(HTMLPurifier_Config $config) now clones the object - Attribute minimization for HTML implemented in Generator - Move div@align fix from proprietary to regular set - Color keywords now map to full six digit hexadecimal codes - Harness will now tack on per-use-case configuration git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1084 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
23
tests/HTMLPurifier/AttrDef/HTML/ColorTest.php
Normal file
23
tests/HTMLPurifier/AttrDef/HTML/ColorTest.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/AttrDefHarness.php';
|
||||
require_once 'HTMLPurifier/AttrDef/HTML/Color.php';
|
||||
|
||||
class HTMLPurifier_AttrDef_HTML_ColorTest extends HTMLPurifier_AttrDefHarness
|
||||
{
|
||||
|
||||
function test() {
|
||||
$this->def = new HTMLPurifier_AttrDef_HTML_Color();
|
||||
$this->assertDef('', false);
|
||||
$this->assertDef('foo', false);
|
||||
$this->assertDef('43', false);
|
||||
$this->assertDef('red', '#FF0000');
|
||||
$this->assertDef('#FF0000');
|
||||
$this->assertDef('#453443');
|
||||
$this->assertDef('453443', '#453443');
|
||||
$this->assertDef('#345', '#334455');
|
||||
$this->assertDef('120', '#112200');
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user