$this->
assertSame($expected,
$this->
getOutputContent($output));
} public function testColumnMaxWidths() { $table =
new Table($output =
$this->
getOutputStream());
$table ->
setRows([ ['Divine Comedy', 'A Tale of Two Cities', 'The Lord of the Rings', 'And Then There Were None'
],
]) ->
setColumnMaxWidth(1, 5
) ->
setColumnMaxWidth(2, 10
) ->
setColumnMaxWidth(3, 15
);
$table->
render();
$expected =
<<<TABLE
+---------------+-------+----------+----------------+
| Divine Comedy | A | The Lord | And Then There |
| | Tale | of the | Were None |
| | of | Rings | |
| | Two | | |
| | Citie | | |
| | s | | |
+---------------+-------+----------+----------------+