mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-10-17 23:16:06 +02:00
Minor test-case refactoring.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@1100 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
@@ -11,13 +11,12 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
||||
$this->obj = new HTMLPurifier_Strategy_MakeWellFormed();
|
||||
}
|
||||
|
||||
function test() {
|
||||
|
||||
$this->config = array('HTML.Doctype' => 'XHTML 1.0 Strict');
|
||||
|
||||
function testNormalIntegration() {
|
||||
$this->assertResult('');
|
||||
$this->assertResult('This is <b>bold text</b>.');
|
||||
|
||||
}
|
||||
|
||||
function testUnclosedTagIntegration() {
|
||||
$this->assertResult(
|
||||
'<b>Unclosed tag, gasp!',
|
||||
'<b>Unclosed tag, gasp!</b>'
|
||||
@@ -32,7 +31,9 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
||||
'Unused end tags... recycle!</b>',
|
||||
'Unused end tags... recycle!'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
function testEmptyTagDetectionIntegration() {
|
||||
$this->assertResult(
|
||||
'<br style="clear:both;">',
|
||||
'<br style="clear:both;" />'
|
||||
@@ -42,8 +43,10 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
||||
'<div style="clear:both;" />',
|
||||
'<div style="clear:both;"></div>'
|
||||
);
|
||||
|
||||
// test automatic paragraph closing
|
||||
}
|
||||
|
||||
function testAutoClose() {
|
||||
// paragraph
|
||||
|
||||
$this->assertResult(
|
||||
'<p>Paragraph 1<p>Paragraph 2',
|
||||
@@ -55,12 +58,20 @@ class HTMLPurifier_Strategy_MakeWellFormedTest extends HTMLPurifier_StrategyHarn
|
||||
'<div><p>Paragraphs</p><p>In</p><p>A</p><p>Div</p></div>'
|
||||
);
|
||||
|
||||
// automatic list closing
|
||||
// list
|
||||
|
||||
$this->assertResult(
|
||||
'<ol><li>Item 1<li>Item 2</ol>',
|
||||
'<ol><li>Item 1</li><li>Item 2</li></ol>'
|
||||
);
|
||||
|
||||
// colgroup
|
||||
|
||||
$this->assertResult(
|
||||
'<table><colgroup><col /><tr></tr></table>',
|
||||
'<table><colgroup><col /></colgroup><tr></tr></table>'
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user