@@ -974,6 +974,42 @@ public function testGetStyleDefinition()
974
974
Table::getStyleDefinition ('absent ' );
975
975
}
976
976
977
+ public function testBoxedStyleWithColspan ()
978
+ {
979
+ $ boxed = new TableStyle ();
980
+ $ boxed
981
+ ->setHorizontalBorderChars ('─ ' )
982
+ ->setVerticalBorderChars ('│ ' )
983
+ ->setCrossingChars ('┼ ' , '┌ ' , '┬ ' , '┐ ' , '┤ ' , '┘ ' , '┴ ' , '└ ' , '├ ' )
984
+ ;
985
+
986
+ $ table = new Table ($ output = $ this ->getOutputStream ());
987
+ $ table ->setStyle ($ boxed );
988
+ $ table
989
+ ->setHeaders (array ('ISBN ' , 'Title ' , 'Author ' ))
990
+ ->setRows (array (
991
+ array ('99921-58-10-7 ' , 'Divine Comedy ' , 'Dante Alighieri ' ),
992
+ new TableSeparator (),
993
+ array (new TableCell ('This value spans 3 columns. ' , array ('colspan ' => 3 ))),
994
+ ))
995
+ ;
996
+ $ table ->render ();
997
+
998
+ $ expected =
999
+ <<<TABLE
1000
+ ┌───────────────┬───────────────┬─────────────────┐
1001
+ │ ISBN │ Title │ Author │
1002
+ ├───────────────┼───────────────┼─────────────────┤
1003
+ │ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
1004
+ ├───────────────┼───────────────┼─────────────────┤
1005
+ │ This value spans 3 columns. │
1006
+ └───────────────┴───────────────┴─────────────────┘
1007
+
1008
+ TABLE ;
1009
+
1010
+ $ this ->assertSame ($ expected , $ this ->getOutputContent ($ output ));
1011
+ }
1012
+
977
1013
protected function getOutputStream ($ decorated = false )
978
1014
{
979
1015
return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
0 commit comments