silverstripe-framework/tests/core/HTMLCleanerTest.php

29 lines
591 B
PHP
Raw Normal View History

<?php
/**
* @package framework
* @subpackage tests
*/
class HTMLCleanerTest extends SapphireTest {
2014-08-15 08:53:05 +02:00
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)');
}
}
}