2006-08-06 01:41:18 +00:00
|
|
|
<?php
|
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
require_once 'HTMLPurifier/AttrDef/HTML/LengthTest.php';
|
|
|
|
require_once 'HTMLPurifier/AttrDef/HTML/MultiLength.php';
|
2006-08-06 01:41:18 +00:00
|
|
|
|
2007-02-14 20:38:51 +00:00
|
|
|
class HTMLPurifier_AttrDef_HTML_MultiLengthTest extends HTMLPurifier_AttrDef_HTML_LengthTest
|
2006-08-06 01:41:18 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
function setup() {
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->def = new HTMLPurifier_AttrDef_HTML_MultiLength();
|
2006-08-06 01:41:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
|
|
|
|
// length check
|
|
|
|
parent::test();
|
|
|
|
|
|
|
|
$this->assertDef('*');
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->assertDef('1*', '*');
|
2006-08-06 01:41:18 +00:00
|
|
|
$this->assertDef('56*');
|
|
|
|
|
|
|
|
$this->assertDef('**', false); // plain old bad
|
|
|
|
|
|
|
|
$this->assertDef('5.4*', '5*'); // no decimals
|
|
|
|
$this->assertDef('-3*', false); // no negatives
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|