You are here

public function LegacyTableHelperTest::testRenderMultiByte in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php \Symfony\Component\Console\Tests\Helper\LegacyTableHelperTest::testRenderMultiByte()

File

vendor/symfony/console/Tests/Helper/LegacyTableHelperTest.php, line 259

Class

LegacyTableHelperTest
@group legacy

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testRenderMultiByte() {
  if (!function_exists('mb_strwidth')) {
    $this
      ->markTestSkipped('The "mbstring" extension is not available');
  }
  $table = new TableHelper();
  $table
    ->setHeaders(array(
    '■■',
  ))
    ->setRows(array(
    array(
      1234,
    ),
  ))
    ->setLayout(TableHelper::LAYOUT_DEFAULT);
  $table
    ->render($output = $this
    ->getOutputStream());
  $expected = <<<TABLE
+------+
| ■■   |
+------+
| 1234 |
+------+

TABLE;
  $this
    ->assertEquals($expected, $this
    ->getOutputContent($output));
}