2006-07-29 17:38:28 +00:00
|
|
|
<?php
|
|
|
|
|
2006-08-05 00:30:31 +00:00
|
|
|
require_once 'HTMLPurifier/StrategyHarness.php';
|
2006-07-29 17:38:28 +00:00
|
|
|
require_once 'HTMLPurifier/Strategy/Core.php';
|
|
|
|
|
|
|
|
class HTMLPurifier_Strategy_CoreTest
|
2006-08-05 00:30:31 +00:00
|
|
|
extends HTMLPurifier_StrategyHarness
|
2006-07-29 17:38:28 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
function test() {
|
|
|
|
$strategy = new HTMLPurifier_Strategy_Core();
|
|
|
|
|
|
|
|
$inputs = array();
|
|
|
|
$expect = array();
|
|
|
|
|
|
|
|
$inputs[0] = '';
|
|
|
|
$expect[0] = '';
|
|
|
|
|
|
|
|
$inputs[1] = '<b>Make well formed.';
|
|
|
|
$expect[1] = '<b>Make well formed.</b>';
|
|
|
|
|
|
|
|
// behavior may change
|
|
|
|
$inputs[2] = '<b><div>Fix nesting.</div></b>';
|
|
|
|
$expect[2] = '<b><div>Fix nesting.</div></b>';
|
|
|
|
|
|
|
|
// behavior may change
|
|
|
|
$inputs[3] = '<asdf>Foreign element removal.</asdf>';
|
|
|
|
$expect[3] = '<asdf>Foreign element removal.</asdf>';
|
|
|
|
|
|
|
|
// behavior may change
|
|
|
|
$inputs[4] = '<foo><b><div>All three.</div></b>';
|
|
|
|
$expect[4] = '<foo><b><div>All three.</div></b>';
|
|
|
|
|
|
|
|
$this->assertStrategyWorks($strategy, $inputs, $expect);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|