R = new Doku_Renderer_xhtml();
    }
    function tearDown() {
        unset($this->R);
    }
    function test_tableopen_0arg() {
        $this->R->table_open();
        $expected = '
'."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_tableopen_1arg() {
        $this->R->table_open(4);
        $expected = ''."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_tableopen_2arg() {
        $this->R->table_open(4, 4);
        $expected = ''."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_tableopen_3arg() {
        $this->R->table_open(4, 4, 100);
        $expected = ''."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_tableopen_4arg_str() {
        $this->R->table_open(4, 4, 100, 'feature');
        $expected = ''."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_tableopen_4arg_arr() {
        $this->R->table_open(4, 4, 100, array('feature', 'test'));
        $expected = ''."\n";
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_table() {
        $this->R->table_open(null, null, null, 'feature');
        $this->R->tablethead_open();
        $this->R->tablerow_open('item');
        $this->R->tableheader_open();
        $this->R->cdata('header1');
        $this->R->tableheader_close();
        $this->R->tableheader_open(1, null, 1, 'second');
        $this->R->cdata('header2');
        $this->R->tableheader_close();
        $this->R->tablerow_close();
        $this->R->tablethead_close();
        $this->R->tabletbody_open();
        $this->R->tablerow_open('values');
        $this->R->tablecell_open(1, null, 1, 'first value');
        $this->R->cdata('cell1,1');
        $this->R->tablecell_close();
        $this->R->tablecell_open(1, null, 1, 'second');
        $this->R->cdata('cell1,2');
        $this->R->tablecell_close();
        $this->R->tablerow_close();
        $this->R->tablerow_open();
        $this->R->tablecell_open();
        $this->R->cdata('cell2.1');
        $this->R->tablecell_close();
        $this->R->tablecell_open();
        $this->R->cdata('cell2,2');
        $this->R->tablecell_close();
        $this->R->tablerow_close();
        $this->R->tabletbody_close();
        $this->R->table_close();
        $expected = '
	
	
		| header1 | header2 | 
	
	
	
		| cell1,1 | cell1,2 | 
	
		| cell2.1 | cell2,2 | 
	
- item1 - 
- item1b 
 
- item2 
- item3 - 
- item3b 
 
';
        $this->assertEquals($expected, $this->R->doc);
    }
    function test_ulist() {
        $this->R->document_start();
        $this->R->listu_open();
        $this->R->listitem_open(1, Doku_Handler_List::NODE);
        $this->R->listcontent_open();
        $this->R->cdata('item1');
        $this->R->listcontent_close();
        $this->R->listu_open();
        $this->R->listitem_open(2);
        $this->R->listcontent_open();
        $this->R->cdata('item1b');
        $this->R->listcontent_close();
        $this->R->listitem_close();
        $this->R->listu_close();
        $this->R->listitem_close();
        $this->R->listitem_open(1);
        $this->R->listcontent_open();
        $this->R->cdata('item2');
        $this->R->listcontent_close();
        $this->R->listitem_close();
        $this->R->listitem_open(1, Doku_Handler_List::NODE);
        $this->R->listcontent_open();
        $this->R->cdata('item3');
        $this->R->listcontent_close();
        $this->R->listu_open('special');
        $this->R->listitem_open(2);
        $this->R->listcontent_open();
        $this->R->cdata('item3b');
        $this->R->listcontent_close();
        $this->R->listitem_close();
        $this->R->listu_close();
        $this->R->listitem_close();
        $this->R->listu_close();
        $this->R->document_end();
        $expected = '
';
        $this->assertEquals($expected, $this->R->doc);
    }
    public function test_blankHeader() {
        $this->R->header('0', 1, 1);
        $expected = '0
';
        $this->assertEquals($expected, trim($this->R->doc));
    }
    public function test_blankTitleLink() {
        global $conf;
        $id = 'blanktest';
        $conf['useheading'] = 1;
        saveWikiText($id,'====== 0 ======', 'test');
        $this->assertTrue(page_exists($id));
        $header = p_get_first_heading($id, METADATA_RENDER_UNLIMITED);
        $this->assertSame('0', $header);
        $this->R->internallink($id);
        $expected = '0';
        $this->assertEquals($expected, trim($this->R->doc));
    }
}