0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00
htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php
Edward Z. Yang 10ea44932a Revamp URITest to use the harness.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@214 48356398-32a2-884e-a903-53898d9a118a
2006-08-12 16:32:57 +00:00

30 lines
857 B
PHP

<?php
class HTMLPurifier_AttrDefHarness extends UnitTestCase
{
var $def;
var $context;
var $config;
// cannot be used for accumulator
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, $message);
} else {
$this->assertIdentical($expect, $result, $message);
}
$this->tearDownAssertDef();
}
function setUpAssertDef() {}
function tearDownAssertDef() {}
}
?>