mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2024-12-23 08:51:53 +00:00
3b1c40b2fc
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1050 48356398-32a2-884e-a903-53898d9a118a
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
require_once 'HTMLPurifier/HTMLModuleHarness.php';
|
|
|
|
class HTMLPurifier_HTMLModule_ImageTest extends HTMLPurifier_HTMLModuleHarness
|
|
{
|
|
|
|
function test() {
|
|
|
|
// max
|
|
$this->assertResult(
|
|
'<span>
|
|
<img
|
|
src="example.png"
|
|
alt="Example image"
|
|
longdesc="example.description.txt"
|
|
height="42"
|
|
width="42"
|
|
/>
|
|
</span>'
|
|
);
|
|
|
|
// required attributes
|
|
$this->assertResult(
|
|
'<img src="foo.png" />',
|
|
'<img src="foo.png" alt="foo.png" />'
|
|
);
|
|
|
|
// empty
|
|
$this->assertResult(
|
|
'<img src="foo.png" alt="foo">',
|
|
'<img src="foo.png" alt="foo" />'
|
|
);
|
|
|
|
// unsupported attributes
|
|
$this->assertResult(
|
|
'<img
|
|
src="example.png"
|
|
alt="Example"
|
|
usemap="#foo"
|
|
ismap="ismap"
|
|
/>',
|
|
'<img src="example.png" alt="Example" />'
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|