@@ -185,7 +185,6 @@ public function testFormat()
185
185
{
186
186
$ expected =
187
187
' 0/10 [>---------------------------] 0% ' .
188
- $ this ->generateOutput (' 10/10 [============================] 100% ' ).
189
188
$ this ->generateOutput (' 10/10 [============================] 100% ' )
190
189
;
191
190
@@ -294,7 +293,6 @@ public function testPercent()
294
293
rewind ($ output ->getStream ());
295
294
$ this ->assertEquals (
296
295
' 0/50 [>---------------------------] 0% ' .
297
- $ this ->generateOutput (' 0/50 [>---------------------------] 0% ' ).
298
296
$ this ->generateOutput (' 1/50 [>---------------------------] 2% ' ).
299
297
$ this ->generateOutput (' 2/50 [=>--------------------------] 4% ' ),
300
298
stream_get_contents ($ output ->getStream ())
@@ -316,7 +314,6 @@ public function testOverwriteWithShorterLine()
316
314
rewind ($ output ->getStream ());
317
315
$ this ->assertEquals (
318
316
' 0/50 [>---------------------------] 0% ' .
319
- $ this ->generateOutput (' 0/50 [>---------------------------] 0% ' ).
320
317
$ this ->generateOutput (' 1/50 [>---------------------------] 2% ' ).
321
318
$ this ->generateOutput (' 2/50 [=>--------------------------] ' ),
322
319
stream_get_contents ($ output ->getStream ())
@@ -350,7 +347,6 @@ public function testSetCurrentProgress()
350
347
rewind ($ output ->getStream ());
351
348
$ this ->assertEquals (
352
349
' 0/50 [>---------------------------] 0% ' .
353
- $ this ->generateOutput (' 0/50 [>---------------------------] 0% ' ).
354
350
$ this ->generateOutput (' 1/50 [>---------------------------] 2% ' ).
355
351
$ this ->generateOutput (' 15/50 [========>-------------------] 30% ' ).
356
352
$ this ->generateOutput (' 25/50 [==============>-------------] 50% ' ),
@@ -457,7 +453,6 @@ public function testPercentNotHundredBeforeComplete()
457
453
rewind ($ output ->getStream ());
458
454
$ this ->assertEquals (
459
455
' 0/200 [>---------------------------] 0% ' .
460
- $ this ->generateOutput (' 0/200 [>---------------------------] 0% ' ).
461
456
$ this ->generateOutput (' 199/200 [===========================>] 99% ' ).
462
457
$ this ->generateOutput (' 200/200 [============================] 100% ' ),
463
458
stream_get_contents ($ output ->getStream ())
@@ -802,4 +797,19 @@ public function testBarWidthWithMultilineFormat()
802
797
$ this ->assertEquals (5 , $ bar ->getBarWidth (), stream_get_contents ($ output ->getStream ()));
803
798
putenv ('COLUMNS=120 ' );
804
799
}
800
+
801
+ public function testNoWriteWhenMessageIsSame (): void
802
+ {
803
+ $ bar = new ProgressBar ($ output = $ this ->getOutputStream (), 2 );
804
+ $ bar ->start ();
805
+ $ bar ->advance ();
806
+ $ bar ->display ();
807
+
808
+ rewind ($ output ->getStream ());
809
+ $ this ->assertEquals (
810
+ ' 0/2 [>---------------------------] 0% ' .
811
+ $ this ->generateOutput (' 1/2 [==============>-------------] 50% ' ),
812
+ stream_get_contents ($ output ->getStream ())
813
+ );
814
+ }
805
815
}
0 commit comments