You are here

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

File

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

Class

ProgressBarTest

Namespace

Symfony\Component\Console\Tests\Helper

Code

public function testCustomizations() {
  $bar = new ProgressBar($output = $this
    ->getOutputStream(), 10);
  $bar
    ->setBarWidth(10);
  $bar
    ->setBarCharacter('_');
  $bar
    ->setEmptyBarCharacter(' ');
  $bar
    ->setProgressCharacter('/');
  $bar
    ->setFormat(' %current%/%max% [%bar%] %percent:3s%%');
  $bar
    ->start();
  $bar
    ->advance();
  rewind($output
    ->getStream());
  $this
    ->assertEquals($this
    ->generateOutput('  0/10 [/         ]   0%') . $this
    ->generateOutput('  1/10 [_/        ]  10%'), stream_get_contents($output
    ->getStream()));
}