3 // we're using empty tags to compact the tests: under real circumstances
4 // there would be contents in them
6 class HTMLPurifier_ChildDef_TableTest
extends HTMLPurifier_ChildDefHarness
11 $this->obj
= new HTMLPurifier_ChildDef_Table();
14 function testEmptyInput() {
15 $this->assertResult('', false);
18 function testSingleRow() {
19 $this->assertResult('<tr />');
22 function testComplexContents() {
23 $this->assertResult('<caption /><col /><thead /><tfoot /><tbody>'.
24 '<tr><td>asdf</td></tr></tbody>');
25 $this->assertResult('<col /><col /><col /><tr />');
28 function testReorderContents() {
30 '<col /><colgroup /><tbody /><tfoot /><thead /><tr>1</tr><caption /><tr />',
31 '<caption /><col /><colgroup /><thead /><tfoot /><tbody /><tr>1</tr><tr />');
34 function testDuplicateProcessing() {
36 '<caption>1</caption><caption /><tbody /><tbody /><tfoot>1</tfoot><tfoot />',
37 '<caption>1</caption><tfoot>1</tfoot><tbody /><tbody /><tbody />'
41 function testRemoveText() {
42 $this->assertResult('foo', false);
45 function testStickyWhitespaceOnTr() {
46 $this->config
->set('Output.Newline', "\n");
47 $this->assertResult("\n <tr />\n <tr />\n ");
50 function testStickyWhitespaceOnTSection() {
51 $this->config
->set('Output.Newline', "\n");
53 "\n\t<tbody />\n\t\t<tfoot />\n\t\t\t",
54 "\n\t\t<tfoot />\n\t<tbody />\n\t\t\t"