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';
|
|
|
|
|
2006-10-01 21:55:13 +00:00
|
|
|
class HTMLPurifier_Strategy_CoreTest extends HTMLPurifier_StrategyHarness
|
2006-07-29 17:38:28 +00:00
|
|
|
{
|
|
|
|
|
2006-10-01 21:55:13 +00:00
|
|
|
function setUp() {
|
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_Strategy_Core();
|
|
|
|
}
|
|
|
|
|
2006-07-29 17:38:28 +00:00
|
|
|
function test() {
|
|
|
|
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult('');
|
|
|
|
$this->assertResult(
|
|
|
|
'<b>Make well formed.',
|
|
|
|
'<b>Make well formed.</b>'
|
|
|
|
);
|
|
|
|
$this->assertResult(
|
|
|
|
'<b><div>Fix nesting.</div></b>',
|
|
|
|
'<b>Fix nesting.</b>'
|
|
|
|
);
|
|
|
|
$this->assertResult(
|
|
|
|
'<asdf>Foreign element removal.</asdf>',
|
|
|
|
'Foreign element removal.'
|
|
|
|
);
|
|
|
|
$this->assertResult(
|
|
|
|
'<foo><b><div>All three.</div></b>',
|
|
|
|
'<b>All three.</b>'
|
|
|
|
);
|
2006-07-29 17:38:28 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|