Skip to content

Commit

Permalink
Merge branch '7.1' into 7.2
Browse files Browse the repository at this point in the history
* 7.1:
  [Console] Fix division by 0 error
  [ErrorHandler] Fix error message with PHP 8.5
  add test covering associated entities referenced by their primary key
  Add an experimental CI job for PHP 8.5
  Fix change log to mentioned thrown exception
  [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 23c8aae + d205904 commit 13189ef
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 13189ef

Please sign in to comment.