@@ -35,9 +35,9 @@ protected function tearDown()
3535 /**
3636 * @dataProvider testRenderProvider
3737 */
38- public function testRender ($ headers , $ rows , $ style , $ expected )
38+ public function testRender ($ headers , $ rows , $ style , $ expected, $ decorated = false )
3939 {
40- $ table = new Table ($ output = $ this ->getOutputStream ());
40+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
4141 $ table
4242 ->setHeaders ($ headers )
4343 ->setRows ($ rows )
@@ -51,9 +51,9 @@ public function testRender($headers, $rows, $style, $expected)
5151 /**
5252 * @dataProvider testRenderProvider
5353 */
54- public function testRenderAddRows ($ headers , $ rows , $ style , $ expected )
54+ public function testRenderAddRows ($ headers , $ rows , $ style , $ expected, $ decorated = false )
5555 {
56- $ table = new Table ($ output = $ this ->getOutputStream ());
56+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
5757 $ table
5858 ->setHeaders ($ headers )
5959 ->addRows ($ rows )
@@ -67,9 +67,9 @@ public function testRenderAddRows($headers, $rows, $style, $expected)
6767 /**
6868 * @dataProvider testRenderProvider
6969 */
70- public function testRenderAddRowsOneByOne ($ headers , $ rows , $ style , $ expected )
70+ public function testRenderAddRowsOneByOne ($ headers , $ rows , $ style , $ expected, $ decorated = false )
7171 {
72- $ table = new Table ($ output = $ this ->getOutputStream ());
72+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
7373 $ table
7474 ->setHeaders ($ headers )
7575 ->setStyle ($ style )
@@ -485,6 +485,35 @@ public function testRenderProvider()
485485
486486TABLE
487487 ),
488+ 'Coslpan and table cells with comment style ' => array (
489+ array (
490+ new TableCell ('<comment>Long Title</comment> ' , array ('colspan ' => 3 )),
491+ ),
492+ array (
493+ array (
494+ new TableCell ('9971-5-0210-0 ' , array ('colspan ' => 3 )),
495+ ),
496+ new TableSeparator (),
497+ array (
498+ 'Dante Alighieri ' ,
499+ 'J. R. R. Tolkien ' ,
500+ 'J. R. R ' ,
501+ ),
502+ ),
503+ 'default ' ,
504+ <<<TABLE
505+ +-----------------+------------------+---------+
506+ | \033[32m \033[39m \033[33mLong Title \033[39m \033[32m \033[39m|
507+ +-----------------+------------------+---------+
508+ | 9971-5-0210-0 |
509+ +-----------------+------------------+---------+
510+ | Dante Alighieri | J. R. R. Tolkien | J. R. R |
511+ +-----------------+------------------+---------+
512+
513+ TABLE
514+ ,
515+ true ,
516+ ),
488517 );
489518 }
490519
@@ -650,9 +679,9 @@ public function testGetStyleDefinition()
650679 Table::getStyleDefinition ('absent ' );
651680 }
652681
653- protected function getOutputStream ()
682+ protected function getOutputStream ($ decorated = false )
654683 {
655- return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , false );
684+ return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
656685 }
657686
658687 protected function getOutputContent (StreamOutput $ output )
0 commit comments