Skip to content
Permalink
Browse files

add a test for spaces

  • Loading branch information...
thinkingmedia
thinkingmedia committed Jan 6, 2017
1 parent bc2e828 commit a15f006d86aa3ddc4498805040d6ef32cf5da6a9
Showing with 36 additions and 0 deletions.
  1. +36 −0 tests/TestCase/Shell/Helper/TableHelperTest.php
@@ -24,6 +24,20 @@
*/
class TableHelperTest extends TestCase
{
/**
* @var ConsoleOutput
*/
public $stub;
/**
* @var ConsoleIo
*/
public $io;
/**
* @var TableHelper
*/
public $helper;
/**
* setUp method
@@ -63,6 +77,28 @@ public function testDefaultOutput()
$this->assertEquals($expected, $this->stub->messages());
}
/**
* Test that output works when data contains just empty strings.
*/
public function testEmptyStrings()
{
$data = [
['Header 1', 'Header', 'Empty'],
['short', 'Longish thing', ''],
['Longer thing', 'short', ''],
];
$this->helper->output($data);
$expected = [
'+--------------+---------------+-------+',
'| <info>Header 1</info> | <info>Header</info> | <info>Empty</info> |',
'+--------------+---------------+-------+',
'| short | Longish thing | |',
'| Longer thing | short | |',
'+--------------+---------------+-------+',
];
$this->assertEquals($expected, $this->stub->messages());
}
/**
* Test output with multi-byte characters
*

0 comments on commit a15f006

Please sign in to comment.
You can’t perform that action at this time.