0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-11-14 01:08:41 +00:00
htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php

30 lines
857 B
PHP
Raw Normal View History

<?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
if (!$this->config) $this->config = HTMLPurifier_Config::createDefault();
if (!$this->context) $this->context = new HTMLPurifier_AttrContext();
$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);
}
$this->tearDownAssertDef();
}
function setUpAssertDef() {}
function tearDownAssertDef() {}
}
?>