2006-07-29 17:38:28 +00:00
|
|
|
<?php
|
|
|
|
|
2006-10-01 21:55:13 +00:00
|
|
|
class HTMLPurifier_Strategy_CoreTest extends HTMLPurifier_StrategyHarness
|
2006-07-29 17:38:28 +00:00
|
|
|
{
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function setUp()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
parent::setUp();
|
|
|
|
$this->obj = new HTMLPurifier_Strategy_Core();
|
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testBlankInput()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult('');
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testMakeWellFormed()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b>Make well formed.',
|
|
|
|
'<b>Make well formed.</b>'
|
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testFixNesting()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<b><div>Fix nesting.</div></b>',
|
2008-12-20 18:06:00 +00:00
|
|
|
'<b></b><div><b>Fix nesting.</b></div><b></b>'
|
2006-10-01 21:55:13 +00:00
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testRemoveForeignElements()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<asdf>Foreign element removal.</asdf>',
|
|
|
|
'Foreign element removal.'
|
|
|
|
);
|
2007-08-06 06:22:23 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2013-07-16 11:56:14 +00:00
|
|
|
public function testFirstThree()
|
|
|
|
{
|
2006-10-01 21:55:13 +00:00
|
|
|
$this->assertResult(
|
|
|
|
'<foo><b><div>All three.</div></b>',
|
2008-12-20 18:06:00 +00:00
|
|
|
'<b></b><div><b>All three.</b></div><b></b>'
|
2006-10-01 21:55:13 +00:00
|
|
|
);
|
2006-07-29 17:38:28 +00:00
|
|
|
}
|
2008-12-06 07:28:20 +00:00
|
|
|
|
2006-07-29 17:38:28 +00:00
|
|
|
}
|
|
|
|
|
2008-12-06 09:24:59 +00:00
|
|
|
// vim: et sw=4 sts=4
|