1
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2025-08-09 23:57:03 +02:00

Revamp URITest to use the harness.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@214 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang
2006-08-12 16:32:57 +00:00
parent ebe01a0a24
commit 10ea44932a
2 changed files with 62 additions and 42 deletions

View File

@@ -8,18 +8,23 @@ class HTMLPurifier_AttrDefHarness extends UnitTestCase
var $config;
// cannot be used for accumulator
function assertDef($string, $expect = true) {
function assertDef($string, $expect = true, $message = '%s') {
// $expect can be a string or bool
$this->setUpAssertDef();
if (!$this->config) $this->config = HTMLPurifier_Config::createDefault();
if (!$this->context) $this->context = new HTMLPurifier_AttrContext();
$result = $this->def->validate($string, $this->config, $this->context);
if ($expect === true) {
$this->assertIdentical($string, $result);
$this->assertIdentical($string, $result, $message);
} else {
$this->assertIdentical($expect, $result);
$this->assertIdentical($expect, $result, $message);
}
$this->tearDownAssertDef();
}
function setUpAssertDef() {}
function tearDownAssertDef() {}
}
?>