Skip to content
Permalink
Browse files

add a test for nulls

  • Loading branch information...
thinkingmedia
thinkingmedia committed Jan 6, 2017
1 parent a15f006 commit aa6fd355152276b7fee22e7503023b42c6d29c93
Showing with 22 additions and 0 deletions.
  1. +22 −0 tests/TestCase/Shell/Helper/TableHelperTest.php
@@ -99,6 +99,28 @@ public function testEmptyStrings()
$this->assertEquals($expected, $this->stub->messages());
}
/**
* Test that output works when data contains just empty strings.
*/
public function testNullValues()
{
$data = [
['Header 1', 'Header', 'Empty'],
['short', 'Longish thing', null],
['Longer thing', 'short', null],
];
$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 aa6fd35

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