You are here

public function ProgressBarTest::testPercentNotHundredBeforeComplete 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::testPercentNotHundredBeforeComplete()

File

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

Class

ProgressBarTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testPercentNotHundredBeforeComplete() {
  $bar = new ProgressBar($output = $this
    ->getOutputStream(), 200);
  $bar
    ->start();
  $bar
    ->display();
  $bar
    ->advance(199);
  $bar
    ->advance();
  rewind($output
    ->getStream());
  $this
    ->assertEquals($this
    ->generateOutput('   0/200 [>---------------------------]   0%') . $this
    ->generateOutput('   0/200 [>---------------------------]   0%') . $this
    ->generateOutput(' 199/200 [===========================>]  99%') . $this
    ->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output
    ->getStream()));
}