' 0/50 [>---------------------------] 0%'.\PHP_EOL.
"\x1b[1A\x1b[0J".' 1/50 [>---------------------------] 2%'.\PHP_EOL.
"\x1b[2A\x1b[0J".' 1/50 [>---------------------------] 2%'.\PHP_EOL.
"\x1b[1A\x1b[0J".' 1/50 [>---------------------------] 2%'.\PHP_EOL.
' 1/50 [>---------------------------] 2%'.\PHP_EOL,
stream_get_contents($stream->
getStream()) );
} public function testOverwritWithNewlinesInMessage() { ProgressBar::
setFormatDefinition('test', '%current%/%max% [%bar%] %percent:3s%% %message% Fruitcake marzipan toffee. Cupcake gummi bears tart dessert ice cream chupa chups cupcake chocolate bar sesame snaps. Croissant halvah cookie jujubes powder macaroon. Fruitcake bear claw bonbon jelly beans oat cake pie muffin Fruitcake marzipan toffee.'
);
$bar =
new ProgressBar($output =
$this->
getOutputStream(), 50, 0
);
$bar->
setFormat('test'
);
$bar->
start();
$bar->
display();
$bar->
setMessage("Twas brillig, and the slithy toves. Did gyre and gimble in the wabe: All mimsy were the borogoves, And the mome raths outgrabe.\nBeware the Jabberwock, my son! The jaws that bite, the claws that catch! Beware the Jubjub bird, and shun The frumious Bandersnatch!"
);
$bar->
advance();
$bar->
setMessage("He took his vorpal sword in hand; Long time the manxome foe he sought— So rested he by the Tumtum tree And stood awhile in thought.\nAnd, as in uffish thought he stood, The Jabberwock, with eyes of flame, Came whiffling through the tulgey wood, And burbled as it came!"
);
$bar->
advance();
rewind($output->
getStream());