mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-09-03 16:28:00 +02:00
28 lines
611 B
PHP
28 lines
611 B
PHP
|
<?php
|
||
|
/**
|
||
|
* @package sapphire
|
||
|
* @subpackage tests
|
||
|
*/
|
||
|
|
||
|
class HTMLCleanerTest extends SapphireTest {
|
||
|
|
||
|
function testHTMLClean() {
|
||
|
$cleaner = HTMLCleaner::inst();
|
||
|
|
||
|
if ($cleaner) {
|
||
|
$this->assertEquals(
|
||
|
$cleaner->cleanHTML('<p>wrong <b>nesting</i></p>' . "\n"),
|
||
|
'<p>wrong <b>nesting</b></p>' . "\n",
|
||
|
"HTML cleaned properly"
|
||
|
);
|
||
|
$this->assertEquals(
|
||
|
$cleaner->cleanHTML('<p>unclosed paragraph' . "\n"),
|
||
|
'<p>unclosed paragraph</p>' . "\n",
|
||
|
"HTML cleaned properly"
|
||
|
);
|
||
|
} else {
|
||
|
$this->markTestSkipped('No HTMLCleaner library available (tidy or HTMLBeautifier)');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|