You are here

public function LegacyProgressHelperTest::testMultiByteSupport in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Helper/LegacyProgressHelperTest.php, line 170

Class

LegacyProgressHelperTest
@group legacy

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testMultiByteSupport() {
  if (!function_exists('mb_strlen') || false === ($encoding = mb_detect_encoding('■'))) {
    $this
      ->markTestSkipped('The mbstring extension is needed for multi-byte support');
  }
  $progress = new ProgressHelper();
  $progress
    ->start($output = $this
    ->getOutputStream());
  $progress
    ->setBarCharacter('■');
  $progress
    ->advance(3);
  rewind($output
    ->getStream());
  $this
    ->assertEquals($this
    ->generateOutput('    3 [■■■>------------------------]'), stream_get_contents($output
    ->getStream()));
}