2006-08-04 02:48:20 +00:00
|
|
|
<?php
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_HTML_NmtokensTest extends HTMLPurifier_AttrDefHarness
|
2006-08-04 02:48:20 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2009-05-26 01:55:44 +00:00
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->def = new HTMLPurifier_AttrDef_HTML_Nmtokens();
|
2009-05-26 01:55:44 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function testDefault() {
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-05 00:30:31 +00:00
|
|
|
$this->assertDef('valid');
|
|
|
|
$this->assertDef('a0-_');
|
|
|
|
$this->assertDef('-valid');
|
|
|
|
$this->assertDef('_valid');
|
|
|
|
$this->assertDef('double valid');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-05 00:30:31 +00:00
|
|
|
$this->assertDef('0invalid', false);
|
|
|
|
$this->assertDef('-0', false);
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 02:48:20 +00:00
|
|
|
// test conditional replacement
|
2006-08-05 00:30:31 +00:00
|
|
|
$this->assertDef('validassoc 0invalid', 'validassoc');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 02:48:20 +00:00
|
|
|
// test whitespace leniency
|
2006-08-05 00:30:31 +00:00
|
|
|
$this->assertDef(" double\nvalid\r", 'double valid');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-05 19:52:30 +00:00
|
|
|
// test case sensitivity
|
|
|
|
$this->assertDef('VALID');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 02:48:20 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-04 02:48:20 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|