silverstripe-framework/tests/php/Core/HTMLCleanerTest.php

31 lines
805 B
PHP
Raw Normal View History

<?php
2016-10-14 03:30:05 +02:00
namespace SilverStripe\Core\Tests;
use SilverStripe\Dev\SapphireTest;
use SilverStripe\View\Parsers\HTMLCleaner;
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)');
}
}
}