mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-07-11 17:56:19 +02:00
[1.7.0] Add some module unit tests for Edit, Hypertext, Image and Legacy (incomplete). Remove redundant img scaffolding.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1050 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
58
tests/HTMLPurifier/HTMLModule/EditTest.php
Normal file
58
tests/HTMLPurifier/HTMLModule/EditTest.php
Normal file
@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
require_once 'HTMLPurifier/HTMLModuleHarness.php';
|
||||
|
||||
class HTMLPurifier_HTMLModule_EditTest extends HTMLPurifier_HTMLModuleHarness
|
||||
{
|
||||
|
||||
function test() {
|
||||
|
||||
// max
|
||||
$this->assertResult(
|
||||
'<span>
|
||||
<ins cite="http://www.example.com/">
|
||||
#PCDATA <span></span>
|
||||
</ins>
|
||||
<del cite="http://www.example.com/">
|
||||
#PCDATA <span></span>
|
||||
</del>
|
||||
</span>
|
||||
<div>
|
||||
<ins cite="http://www.example.com/">
|
||||
#PCDATA <div></div> <span></span>
|
||||
</ins>
|
||||
<del cite="http://www.example.com/">
|
||||
#PCDATA <div></div> <span></span>
|
||||
</del>
|
||||
</div>'
|
||||
);
|
||||
|
||||
// inline removal
|
||||
$this->assertResult(
|
||||
'<span>
|
||||
<ins><div></div></ins>
|
||||
<del><div></div></del>
|
||||
</span>',
|
||||
'<span>
|
||||
<ins></ins>
|
||||
<del></del>
|
||||
</span>'
|
||||
);
|
||||
|
||||
// unsupported attributes
|
||||
$this->assertResult(
|
||||
'<ins
|
||||
datetime="1994-11-05T13:15:30Z"
|
||||
></ins>
|
||||
<del
|
||||
datetime="1994-11-05T13:15:30Z"
|
||||
></del>',
|
||||
'<ins></ins>
|
||||
<del></del>'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
?>
|
Reference in New Issue
Block a user