@@ -745,6 +745,42 @@ public function testGetStyleDefinition()
745745 Table::getStyleDefinition ('absent ' );
746746 }
747747
748+ public function testBoxedStyleWithColspan ()
749+ {
750+ $ boxed = new TableStyle ();
751+ $ boxed
752+ ->setHorizontalBorderChar ('─ ' )
753+ ->setVerticalBorderChar ('│ ' )
754+ ->setCrossingChar ('┼ ' )
755+ ;
756+
757+ $ table = new Table ($ output = $ this ->getOutputStream ());
758+ $ table ->setStyle ($ boxed );
759+ $ table
760+ ->setHeaders (array ('ISBN ' , 'Title ' , 'Author ' ))
761+ ->setRows (array (
762+ array ('99921-58-10-7 ' , 'Divine Comedy ' , 'Dante Alighieri ' ),
763+ new TableSeparator (),
764+ array (new TableCell ('This value spans 3 columns. ' , array ('colspan ' => 3 ))),
765+ ))
766+ ;
767+ $ table ->render ();
768+
769+ $ expected =
770+ <<<TABLE
771+ ┼───────────────┼───────────────┼─────────────────┼
772+ │ ISBN │ Title │ Author │
773+ ┼───────────────┼───────────────┼─────────────────┼
774+ │ 99921-58-10-7 │ Divine Comedy │ Dante Alighieri │
775+ ┼───────────────┼───────────────┼─────────────────┼
776+ │ This value spans 3 columns. │
777+ ┼───────────────┼───────────────┼─────────────────┼
778+
779+ TABLE ;
780+
781+ $ this ->assertSame ($ expected , $ this ->getOutputContent ($ output ));
782+ }
783+
748784 protected function getOutputStream ($ decorated = false )
749785 {
750786 return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
0 commit comments