1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-05 05:37:49 +02:00

Refactor unit tests so that abstract test cases are now called Harnesses and AttrDef tests use their harness's assertDef() function, which enforces type much better. Also fixed a few bugs.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@161 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-05 00:30:31 +00:00
parent 6232221c08
commit 1945ddca5c
16 changed files with 100 additions and 70 deletions

View File

@@ -1,17 +1,17 @@
<?php
require_once 'HTMLPurifier/AttrDefHarness.php';
require_once 'HTMLPurifier/AttrDef/Text.php';
class HTMLPurifier_AttrDef_TextTest extends UnitTestCase
class HTMLPurifier_AttrDef_TextTest extends HTMLPurifier_AttrDefHarness
{
function test() {
$def = new HTMLPurifier_AttrDef_Text();
$this->def = new HTMLPurifier_AttrDef_Text();
$this->assertTrue($def->validate('This is spiffy text!'));
$this->assertEqual('Casual CDATA parsecheck.',
$def->validate(" Casual\tCDATA parse\ncheck. "));
$this->assertDef('This is spiffy text!');
$this->assertDef(" Casual\tCDATA parse\ncheck. ", 'Casual CDATA parsecheck.');
}