@@ -824,6 +824,42 @@ public function testGetStyleDefinition()
824
824
Table::getStyleDefinition ('absent ' );
825
825
}
826
826
827
+ public function testBoxedStyleWithColspan ()
828
+ {
829
+ $ boxed = new TableStyle ();
830
+ $ boxed
831
+ ->setHorizontalBorderChar ('─ ' )
832
+ ->setVerticalBorderChar ('│ ' )
833
+ ->setCrossingChar ('┼ ' )
834
+ ;
835
+
836
+ $ table = new Table ($ output = $ this ->getOutputStream ());
837
+ $ table ->setStyle ($ boxed );
838
+ $ table
839
+ ->setHeaders (array ('ISBN ' , 'Title ' , 'Author ' ))
840
+ ->setRows (array (
841
+ array ('99921-58-10-7 ' , 'Divine Comedy ' , 'Dante Alighieri ' ),
842
+ new TableSeparator (),
843
+ array (new TableCell ('This value spans 3 columns. ' , array ('colspan ' => 3 ))),
844
+ ))
845
+ ;
846
+ $ table ->render ();
847
+
848
+ $ expected =
849
+ <<<TABLE
850
+ ┼───────────────┼───────────────┼─────────────────┼
851
+ │ ISBN │ Title │ Author │
852
+ ┼───────────────┼───────────────┼─────────────────┼
853
+ │ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
854
+ ┼───────────────┼───────────────┼─────────────────┼
855
+ │ This value spans 3 columns. │
856
+ ┼───────────────┼───────────────┼─────────────────┼
857
+
858
+ TABLE ;
859
+
860
+ $ this ->assertSame ($ expected , $ this ->getOutputContent ($ output ));
861
+ }
862
+
827
863
protected function getOutputStream ($ decorated = false )
828
864
{
829
865
return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
0 commit comments