diff options
author | Christopher Smith <chris@jalakai.co.uk> | 2014-03-16 20:26:44 +0000 |
---|---|---|
committer | Christopher Smith <chris@jalakai.co.uk> | 2014-03-16 20:26:44 +0000 |
commit | c2a1d01e2e905ab3d7fa3009aeb140fcefc32f9e (patch) | |
tree | 8146466bdcdca20a9d910a3dd5bc3a70f4604cf1 | |
parent | cef031c123914a2d88f125a8363c0917011e8ed0 (diff) | |
download | rpg-c2a1d01e2e905ab3d7fa3009aeb140fcefc32f9e.tar.gz rpg-c2a1d01e2e905ab3d7fa3009aeb140fcefc32f9e.tar.bz2 |
update unittests for THEAD rules
-rw-r--r-- | _test/tests/inc/parser/parser_table.test.php | 49 |
1 files changed, 48 insertions, 1 deletions
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')), |