2006-08-05 02:16:28 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
class HTMLPurifier_AttrTransformHarness extends UnitTestCase
|
|
|
|
{
|
|
|
|
|
|
|
|
var $transform;
|
|
|
|
|
2006-08-14 23:11:28 +00:00
|
|
|
function assertTransform($inputs, $expect, $config = array()) {
|
|
|
|
$default_config = HTMLPurifier_Config::createDefault();
|
2006-08-05 02:16:28 +00:00
|
|
|
foreach ($inputs as $i => $input) {
|
2006-08-14 23:11:28 +00:00
|
|
|
if (!isset($config[$i])) $config[$i] = $default_config;
|
|
|
|
$result = $this->transform->transform($input, $config[$i]);
|
|
|
|
if ($expect[$i] === true) $expect[$i] = $input;
|
|
|
|
$this->assertEqual($expect[$i], $result, "Test $i: %s");
|
2006-08-05 02:16:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|