Skip to content

Commit

Permalink
Make sure the line that will be overwritten in the CLI ProgressHelper…
Browse files Browse the repository at this point in the history
… does not have a new line feed

Otherwise, it is impossible to be sure that the line that will be overwritten can be without any
visual glitch. Before this change, visual glitch appeared when using Putty on Windows.
  • Loading branch information
HavokInspiration committed Feb 8, 2016
1 parent 4c3cc0b commit a6450b0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Shell/Helper/ProgressHelper.php
Expand Up @@ -69,6 +69,8 @@ public function output($args)
$this->init($args);

$callback = $args['callback'];

$this->_io->out('', 0);
while ($this->_progress < $this->_total) {
$callback($this);
$this->draw();
Expand Down
2 changes: 2 additions & 0 deletions tests/TestCase/Shell/Helper/ProgressHelperTest.php
Expand Up @@ -60,6 +60,7 @@ public function testOutputSuccess()
$progress->increment(20);
}]);
$expected = [
'',
'',
'==============> 20%',
'',
Expand Down Expand Up @@ -90,6 +91,7 @@ public function testOutputSuccessOptions()
}
]);
$expected = [
'',
'',
'==> 20%',
'',
Expand Down

0 comments on commit a6450b0

Please sign in to comment.