From c2a1d01e2e905ab3d7fa3009aeb140fcefc32f9e Mon Sep 17 00:00:00 2001 From: Christopher Smith Date: Sun, 16 Mar 2014 20:26:44 +0000 Subject: update unittests for THEAD rules --- _test/tests/inc/parser/parser_table.test.php | 49 +++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) (limited to '_test/tests') diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php index 3e9651d14..a9b4e284c 100644 --- a/_test/tests/inc/parser/parser_table.test.php +++ b/_test/tests/inc/parser/parser_table.test.php @@ -152,6 +152,7 @@ def'); $this->P->parse(' abc ^ X ^ Y ^ Z ^ +| x | y | z | def'); $calls = array ( @@ -159,7 +160,7 @@ def'); array('p_open',array()), array('cdata',array("\n\nabc")), array('p_close',array()), - array('table_open',array(3, 1, 6)), + array('table_open',array(3, 2, 6)), array('tablethead_open',array()), array('tablerow_open',array()), array('tableheader_open',array(1,NULL,1)), @@ -173,6 +174,52 @@ def'); array('tableheader_close',array()), array('tablerow_close',array()), array('tablethead_close',array()), + array('tablerow_open',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' x ')), + array('tablecell_close',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' y ')), + array('tablecell_close',array()), + array('tablecell_open',array(1,NULL,1)), + array('cdata',array(' z ')), + array('tablecell_close',array()), + array('tablerow_close',array()), + array('table_close',array(33)), + array('p_open',array()), + array('cdata',array('def')), + array('p_close',array()), + array('document_end',array()), + ); + + $this->assertEquals($calls,array_map('stripbyteindex',$this->H->calls)); + + } + + function testTableHeadOneRowTable() { + $this->P->addMode('table',new Doku_Parser_Mode_Table()); + $this->P->parse(' +abc +^ X ^ Y ^ Z ^ +def'); + + $calls = array ( + array('document_start',array()), + array('p_open',array()), + array('cdata',array("\n\nabc")), + array('p_close',array()), + array('table_open',array(3, 1, 6)), + array('tablerow_open',array()), + array('tableheader_open',array(1,NULL,1)), + array('cdata',array(' X ')), + array('tableheader_close',array()), + array('tableheader_open',array(1,NULL,1)), + array('cdata',array(' Y ')), + array('tableheader_close',array()), + array('tableheader_open',array(1,NULL,1)), + array('cdata',array(' Z ')), + array('tableheader_close',array()), + array('tablerow_close',array()), array('table_close',array(19)), array('p_open',array()), array('cdata',array('def')), -- cgit v1.2.3