You are here

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

File

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

Class

LegacyProgressHelperTest
@group legacy

Namespace

Symfony\Component\Console\Tests\Helper

Code

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