mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 17:01:51 +00:00
4193fd018a
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@219 48356398-32a2-884e-a903-53898d9a118a
30 lines
891 B
PHP
30 lines
891 B
PHP
<?php
|
|
|
|
class HTMLPurifier_AttrDefHarness extends UnitTestCase
|
|
{
|
|
|
|
var $def;
|
|
var $context;
|
|
var $config;
|
|
|
|
// cannot be used for accumulator
|
|
function assertDef($string, $expect = true, $ini = false, $message = '%s') {
|
|
// $expect can be a string or bool
|
|
if (!$this->config) $this->config = HTMLPurifier_Config::createDefault();
|
|
if (!$this->context) $this->context = new HTMLPurifier_AttrContext();
|
|
if ($ini) $this->setUpAssertDef();
|
|
$result = $this->def->validate($string, $this->config, $this->context);
|
|
if ($expect === true) {
|
|
$this->assertIdentical($string, $result, $message);
|
|
} else {
|
|
$this->assertIdentical($expect, $result, $message);
|
|
}
|
|
if ($ini) $this->tearDownAssertDef();
|
|
}
|
|
|
|
function setUpAssertDef() {}
|
|
function tearDownAssertDef() {}
|
|
|
|
}
|
|
|
|
?>
|