mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-08-03 20:58:11 +02:00
[1.5.0] AttrDef partitioned into HTML, CSS and URI segments. Also, some minor bugs with MultiLength fixed.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@747 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
35
tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php
Normal file
35
tests/HTMLPurifier/AttrDef/HTML/NmtokensTest.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/AttrDefHarness.php';
|
||||
require_once 'HTMLPurifier/AttrDef/HTML/Nmtokens.php';
|
||||
|
||||
class HTMLPurifier_AttrDef_HTML_NmtokensTest extends HTMLPurifier_AttrDefHarness
|
||||
{
|
||||
|
||||
function testDefault() {
|
||||
|
||||
$this->def = new HTMLPurifier_AttrDef_HTML_Nmtokens();
|
||||
|
||||
$this->assertDef('valid');
|
||||
$this->assertDef('a0-_');
|
||||
$this->assertDef('-valid');
|
||||
$this->assertDef('_valid');
|
||||
$this->assertDef('double valid');
|
||||
|
||||
$this->assertDef('0invalid', false);
|
||||
$this->assertDef('-0', false);
|
||||
|
||||
// test conditional replacement
|
||||
$this->assertDef('validassoc 0invalid', 'validassoc');
|
||||
|
||||
// test whitespace leniency
|
||||
$this->assertDef(" double\nvalid\r", 'double valid');
|
||||
|
||||
// test case sensitivity
|
||||
$this->assertDef('VALID');
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user