2006-08-06 01:41:18 +00:00
|
|
|
<?php
|
|
|
|
|
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
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
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
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
function test() {
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
// length check
|
|
|
|
parent::test();
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
$this->assertDef('*');
|
2007-02-14 20:38:51 +00:00
|
|
|
$this->assertDef('1*', '*');
|
2006-08-06 01:41:18 +00:00
|
|
|
$this->assertDef('56*');
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
$this->assertDef('**', false); // plain old bad
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
$this->assertDef('5.4*', '5*'); // no decimals
|
|
|
|
$this->assertDef('-3*', false); // no negatives
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-08-06 01:41:18 +00:00
|
|
|
}
|
|
|
|
|