You are here

public function ProgressBarTest::testNonDecoratedOutput in Zircon Profile 8

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

File

vendor/symfony/console/Tests/Helper/ProgressBarTest.php, line 324

Class

ProgressBarTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testNonDecoratedOutput() {
  $bar = new ProgressBar($output = $this
    ->getOutputStream(false), 200);
  $bar
    ->start();
  for ($i = 0; $i < 200; ++$i) {
    $bar
      ->advance();
  }
  $bar
    ->finish();
  rewind($output
    ->getStream());
  $this
    ->assertEquals('   0/200 [>---------------------------]   0%' . PHP_EOL . '  20/200 [==>-------------------------]  10%' . PHP_EOL . '  40/200 [=====>----------------------]  20%' . PHP_EOL . '  60/200 [========>-------------------]  30%' . PHP_EOL . '  80/200 [===========>----------------]  40%' . PHP_EOL . ' 100/200 [==============>-------------]  50%' . PHP_EOL . ' 120/200 [================>-----------]  60%' . PHP_EOL . ' 140/200 [===================>--------]  70%' . PHP_EOL . ' 160/200 [======================>-----]  80%' . PHP_EOL . ' 180/200 [=========================>--]  90%' . PHP_EOL . ' 200/200 [============================] 100%', stream_get_contents($output
    ->getStream()));
}