silverstripe-framework/tests/core/HTMLCleanerTest.php
Damian Mooyman 0d7816b55d BUG Fixed issue with Deprecation failing to extract the module from a stacktrace, especially on non-unix systems
API Added Convert::nl2os function to normalise end of line characters across systems with tests
BUG Fixed i18n unit tests in non-unix systems constantly failing
BUG Fixed problems with HTMLCleaner tests failing in non-unix systems
2012-10-17 11:57:16 +13:00

29 lines
592 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>'),
'<p>wrong <b>nesting</b></p>',
"HTML cleaned properly"
);
$this->assertEquals(
$cleaner->cleanHTML('<p>unclosed paragraph'),
'<p>unclosed paragraph</p>',
"HTML cleaned properly"
);
} else {
$this->markTestSkipped('No HTMLCleaner library available (tidy or HTMLBeautifier)');
}
}
}