0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-23 00:41:52 +00:00
htmlpurifier/tests/HTMLPurifier/AttrDefHarness.php

24 lines
613 B
PHP

<?php
class HTMLPurifier_AttrDefHarness extends UnitTestCase
{
var $def;
var $id_accumulator;
var $config;
// cannot be used for accumulator
function assertDef($string, $expect = true) {
// $expect can be a string or bool
if (!$this->config) $this->config = HTMLPurifier_Config::createDefault();
$result = $this->def->validate($string, $this->config, $this->id_accumulator);
if ($expect === true) {
$this->assertIdentical($string, $result);
} else {
$this->assertIdentical($expect, $result);
}
}
}
?>