silverstripe-framework/tests/core/HTMLCleanerTest.php
2012-09-20 10:46:59 +02:00

29 lines
620 B
PHP

<?php
/**
* @package framework
* @subpackage tests
*/
class HTMLCleanerTest extends SapphireTest {
public 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)');
}
}
}