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:
@@ -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.');
|
||||
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user