Skip to content

Commit

Permalink
Merge branch '6.4' into 7.1
Browse files Browse the repository at this point in the history
* 6.4:
  [Console] Fix division by 0 error
  [ErrorHandler] Fix error message with PHP 8.5
  Add an experimental CI job for PHP 8.5
  [HttpClient] Always set CURLOPT_CUSTOMREQUEST to the correct HTTP method in CurlHttpClient
  evaluate access flags for properties with asymmetric visibility
  [Mime] Fix wrong PHPDoc in `FormDataPart` constructor
  • Loading branch information
xabbuh committed Dec 7, 2024
2 parents ff04e5b + 67191f7 commit d205904
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Helper/ProgressBar.php
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ public function getEstimated(): float

public function getRemaining(): float
{
if (!$this->step) {
if (0 === $this->step || $this->step === $this->startingStep) {
return 0;
}

Expand Down
8 changes: 8 additions & 0 deletions Tests/Helper/ProgressBarTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,14 @@ public function testRegularTimeEstimation()
);
}

public function testRegularTimeRemainingWithDifferentStartAtAndCustomDisplay()
{
ProgressBar::setFormatDefinition('custom', ' %current%/%max% [%bar%] %percent:3s%% %remaining% %estimated%');
$bar = new ProgressBar($output = $this->getOutputStream(), 1_200, 0);
$bar->setFormat('custom');
$bar->start(1_200, 600);
}

public function testResumedTimeEstimation()
{
$bar = new ProgressBar($output = $this->getOutputStream(), 1_200, 0);
Expand Down

0 comments on commit d205904

Please sign in to comment.