1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-07-31 03:10:09 +02:00

Commit dud AttrDef integer.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@235 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-13 21:59:52 +00:00
parent eca0f68c1f
commit 71c4a3c50c
3 changed files with 76 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
<?php
require_once 'HTMLPurifier/AttrDef/Integer.php';
class HTMLPurifier_AttrDef_IntegerTest extends HTMLPurifier_AttrDefHarness
{
function test() {
$this->def = new HTMLPurifier_AttrDef_Integer();
$this->assertDef('0');
$this->assertDef('1');
$this->assertDef('-1');
$this->assertDef('-10');
$this->assertDef('14');
$this->assertDef('+24', '24');
$this->assertDef(' 14 ', '14');
$this->assertDef('-1.4', false);
$this->assertDef('3.4', false);
$this->assertDef('asdf', false);
}
function testNonNegative() {
$this->def = new HTMLPurifier_AttrDef_Integer(true);
$this->assertDef('0');
$this->assertDef('1');
$this->assertDef('-1', false);
}
}
?>