2011-03-30 06:46:13 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2011-03-30 06:46:13 +02:00
|
|
|
* @subpackage tests
|
|
|
|
*/
|
|
|
|
|
|
|
|
class HTMLCleanerTest extends SapphireTest {
|
|
|
|
|
2012-09-19 12:07:39 +02:00
|
|
|
public function testHTMLClean() {
|
2011-03-30 06:46:13 +02:00
|
|
|
$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)');
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|