@@ -1077,6 +1077,42 @@ public function testColumnMaxWidths()
1077
1077
$ this ->assertEquals ($ expected , $ this ->getOutputContent ($ output ));
1078
1078
}
1079
1079
1080
+ public function testBoxedStyleWithColspan ()
1081
+ {
1082
+ $ boxed = new TableStyle ();
1083
+ $ boxed
1084
+ ->setHorizontalBorderChars ('─ ' )
1085
+ ->setVerticalBorderChars ('│ ' )
1086
+ ->setCrossingChars ('┼ ' , '┌ ' , '┬ ' , '┐ ' , '┤ ' , '┘ ' , '┴ ' , '└ ' , '├ ' )
1087
+ ;
1088
+
1089
+ $ table = new Table ($ output = $ this ->getOutputStream ());
1090
+ $ table ->setStyle ($ boxed );
1091
+ $ table
1092
+ ->setHeaders (array ('ISBN ' , 'Title ' , 'Author ' ))
1093
+ ->setRows (array (
1094
+ array ('99921-58-10-7 ' , 'Divine Comedy ' , 'Dante Alighieri ' ),
1095
+ new TableSeparator (),
1096
+ array (new TableCell ('This value spans 3 columns. ' , array ('colspan ' => 3 ))),
1097
+ ))
1098
+ ;
1099
+ $ table ->render ();
1100
+
1101
+ $ expected =
1102
+ <<<TABLE
1103
+ ┌───────────────┬───────────────┬─────────────────┐
1104
+ │ ISBN │ Title │ Author │
1105
+ ├───────────────┼───────────────┼─────────────────┤
1106
+ │ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
1107
+ ├───────────────┼───────────────┼─────────────────┤
1108
+ │ This value spans 3 columns. │
1109
+ └───────────────┴───────────────┴─────────────────┘
1110
+
1111
+ TABLE ;
1112
+
1113
+ $ this ->assertSame ($ expected , $ this ->getOutputContent ($ output ));
1114
+ }
1115
+
1080
1116
protected function getOutputStream ($ decorated = false )
1081
1117
{
1082
1118
return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
0 commit comments