Convert all to new configuration get/set format.
[htmlpurifier/darkodev.git] / tests / HTMLPurifier / ChildDef / TableTest.php
blob034e025b3d9c5c760697a2552052751676df8abd
1 <?php
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
9 function setUp() {
10 parent::setUp();
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() {
29 $this->assertResult(
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() {
35 $this->assertResult(
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");
52 $this->assertResult(
53 "\n\t<tbody />\n\t\t<tfoot />\n\t\t\t",
54 "\n\t\t<tfoot />\n\t<tbody />\n\t\t\t"
61 // vim: et sw=4 sts=4