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:
@@ -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() {}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user