Skip to content

Commit 2ac1bb4

Browse files
bburnichonstof
authored andcommitted
[Console] Remove estimated field from debug_nomax
1 parent 6a41ca0 commit 2ac1bb4

File tree

2 files changed

+32
-4
lines changed

2 files changed

+32
-4
lines changed

src/Symfony/Component/Console/Helper/ProgressBar.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -547,13 +547,13 @@ private static function initFormats()
547547
'normal_nomax' => ' %current% [%bar%]',
548548

549549
'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%',
550-
'verbose_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%',
550+
'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
551551

552-
'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%',
553-
'very_verbose_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%',
552+
'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%',
553+
'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
554554

555555
'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
556-
'debug_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
556+
'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%',
557557
);
558558
}
559559
}

src/Symfony/Component/Console/Tests/Helper/ProgressBarTest.php

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,34 @@ public function testSetFormat()
404404
);
405405
}
406406

407+
/**
408+
* @dataProvider provideFormat
409+
*/
410+
public function testFormatsWithoutMax($format)
411+
{
412+
$bar = new ProgressBar($output = $this->getOutputStream());
413+
$bar->setFormat($format);
414+
$bar->start();
415+
416+
rewind($output->getStream());
417+
$this->assertNotEmpty(stream_get_contents($output->getStream()));
418+
}
419+
420+
/**
421+
* Provides each defined format
422+
*
423+
* @return array
424+
*/
425+
public function provideFormat()
426+
{
427+
return array(
428+
array('normal'),
429+
array('verbose'),
430+
array('very_verbose'),
431+
array('debug'),
432+
);
433+
}
434+
407435
protected function getOutputStream($decorated = true)
408436
{
409437
return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated);

0 commit comments

Comments
 (0)