public function tablesUnitTest::testFormatTableHeader

8.0.x tablesUnitTest.php public tablesUnitTest::testFormatTableHeader()
6.x tablesUnitTest.php public tablesUnitTest::testFormatTableHeader()
7.x tablesUnitTest.php public tablesUnitTest::testFormatTableHeader()
master tablesUnitTest.php public tablesUnitTest::testFormatTableHeader()

Tests drush_format_table() with a header.

See also

drush_format_table().

File

tests/tablesUnitTest.php, line 91

Namespace

Unish

Class

tablesUnitTest
Unit tests for table formatting.

Code

public function testFormatTableHeader() {
  drush_set_context('DRUSH_COLUMNS', 16);
  $rows = $this->numbers;
  array_unshift($rows, array('A', 'B', 'C'));
  $output = drush_format_table($rows, TRUE);
  $expected = ' A    B    C    ' . PHP_EOL . ' 1    12   123  ' . PHP_EOL . ' 123  123  1234 ' . PHP_EOL . ' 4    45   56   ' . PHP_EOL . ' 123  123  1234 ' . PHP_EOL . ' 456  456  5678 ' . PHP_EOL . ' 7    78   9    ' . PHP_EOL;
  $this->assertEquals($expected, $output);
}