mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-08-26 04:26:01 +02:00
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
29 lines
592 B
PHP
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)');
|
|
}
|
|
}
|
|
|
|
}
|