File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
src/Symfony/Component/Console Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -229,7 +229,7 @@ public function getEstimated(): float
229229
230230 public function getRemaining (): float
231231 {
232- if (! $ this ->step ) {
232+ if (0 === $ this ->step || $ this -> step === $ this -> startingStep ) {
233233 return 0 ;
234234 }
235235
Original file line number Diff line number Diff line change @@ -110,6 +110,14 @@ public function testRegularTimeEstimation()
110110 );
111111 }
112112
113+ public function testRegularTimeRemainingWithDifferentStartAtAndCustomDisplay ()
114+ {
115+ ProgressBar::setFormatDefinition ('custom ' , ' %current%/%max% [%bar%] %percent:3s%% %remaining% %estimated% ' );
116+ $ bar = new ProgressBar ($ output = $ this ->getOutputStream (), 1_200 , 0 );
117+ $ bar ->setFormat ('custom ' );
118+ $ bar ->start (1_200 , 600 );
119+ }
120+
113121 public function testResumedTimeEstimation ()
114122 {
115123 $ bar = new ProgressBar ($ output = $ this ->getOutputStream (), 1_200 , 0 );
You can’t perform that action at this time.
0 commit comments