summaryrefslogtreecommitdiff
path: root/_test/tests
diff options
context:
space:
mode:
authorGerrit Uitslag <klapinklapin@gmail.com>2013-10-17 23:11:33 +0200
committerGerrit Uitslag <klapinklapin@gmail.com>2013-10-17 23:11:33 +0200
commitf05a1cc5fcdb4c2b6ee3cbf499f980f800dbd105 (patch)
treeace0cef0ea269a14b0879dd351f14d841925c306 /_test/tests
parenta467e020fa551217347181ffd6915c7d29e6ff59 (diff)
downloadrpg-f05a1cc5fcdb4c2b6ee3cbf499f980f800dbd105.tar.gz
rpg-f05a1cc5fcdb4c2b6ee3cbf499f980f800dbd105.tar.bz2
Wrap thead around 1st row, when 1st cell at 1st row is tableheader. Implements FS#1764
Diffstat (limited to '_test/tests')
-rw-r--r--_test/tests/inc/parser/parser_table.test.php51
1 files changed, 51 insertions, 0 deletions
diff --git a/_test/tests/inc/parser/parser_table.test.php b/_test/tests/inc/parser/parser_table.test.php
index 542a307b8..5258afe3d 100644
--- a/_test/tests/inc/parser/parser_table.test.php
+++ b/_test/tests/inc/parser/parser_table.test.php
@@ -125,6 +125,7 @@ def');
array('cdata',array("\n\nabc")),
array('p_close',array()),
array('table_open',array(3, 1, 6)),
+ array('tablethead_open',array()),
array('tablerow_open',array()),
array('tableheader_open',array(1,NULL,1)),
array('cdata',array(' X ')),
@@ -136,6 +137,7 @@ def');
array('cdata',array(' Z ')),
array('tableheader_close',array()),
array('tablerow_close',array()),
+ array('tablethead_close',array()),
array('table_close',array(19)),
array('p_open',array()),
array('cdata',array('def')),
@@ -146,6 +148,55 @@ def');
$this->assertEquals(array_map('stripbyteindex',$this->H->calls),$calls);
}
+
+ function testTableHeadersMultilines() {
+ $this->P->addMode('table',new Doku_Parser_Mode_Table());
+ $this->P->parse('
+abc
+^ X | Y ^ Z |
+| A | B | C |
+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, 2, 6)),
+ array('tablethead_open',array()),
+ array('tablerow_open',array()),
+ array('tableheader_open',array(1,NULL,1)),
+ array('cdata',array(' X ')),
+ array('tableheader_close',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' Y ')),
+ array('tablecell_close',array()),
+ array('tableheader_open',array(1,NULL,1)),
+ array('cdata',array(' Z ')),
+ 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(' A ')),
+ array('tablecell_close',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' B ')),
+ array('tablecell_close',array()),
+ array('tablecell_open',array(1,NULL,1)),
+ array('cdata',array(' C ')),
+ 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(array_map('stripbyteindex',$this->H->calls),$calls);
+
+ }
function testCellAlignment() {
$this->P->addMode('table',new Doku_Parser_Mode_Table());