@@ -35,9 +35,9 @@ protected function tearDown()
35
35
/**
36
36
* @dataProvider testRenderProvider
37
37
*/
38
- public function testRender ($ headers , $ rows , $ style , $ expected )
38
+ public function testRender ($ headers , $ rows , $ style , $ expected, $ decorated = false )
39
39
{
40
- $ table = new Table ($ output = $ this ->getOutputStream ());
40
+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
41
41
$ table
42
42
->setHeaders ($ headers )
43
43
->setRows ($ rows )
@@ -51,9 +51,9 @@ public function testRender($headers, $rows, $style, $expected)
51
51
/**
52
52
* @dataProvider testRenderProvider
53
53
*/
54
- public function testRenderAddRows ($ headers , $ rows , $ style , $ expected )
54
+ public function testRenderAddRows ($ headers , $ rows , $ style , $ expected, $ decorated = false )
55
55
{
56
- $ table = new Table ($ output = $ this ->getOutputStream ());
56
+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
57
57
$ table
58
58
->setHeaders ($ headers )
59
59
->addRows ($ rows )
@@ -67,9 +67,9 @@ public function testRenderAddRows($headers, $rows, $style, $expected)
67
67
/**
68
68
* @dataProvider testRenderProvider
69
69
*/
70
- public function testRenderAddRowsOneByOne ($ headers , $ rows , $ style , $ expected )
70
+ public function testRenderAddRowsOneByOne ($ headers , $ rows , $ style , $ expected, $ decorated = false )
71
71
{
72
- $ table = new Table ($ output = $ this ->getOutputStream ());
72
+ $ table = new Table ($ output = $ this ->getOutputStream ($ decorated ));
73
73
$ table
74
74
->setHeaders ($ headers )
75
75
->setStyle ($ style )
@@ -485,6 +485,35 @@ public function testRenderProvider()
485
485
486
486
TABLE
487
487
),
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
+ ),
488
517
);
489
518
}
490
519
@@ -596,9 +625,9 @@ public function testGetStyleDefinition()
596
625
Table::getStyleDefinition ('absent ' );
597
626
}
598
627
599
- protected function getOutputStream ()
628
+ protected function getOutputStream ($ decorated = false )
600
629
{
601
- return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , false );
630
+ return new StreamOutput ($ this ->stream , StreamOutput::VERBOSITY_NORMAL , $ decorated );
602
631
}
603
632
604
633
protected function getOutputContent (StreamOutput $ output )
0 commit comments