bug #11284 [Console] Remove estimated field from debug_nomax (bburnichon)
This PR was squashed before being merged into the 2.5 branch (closes #11284).
Discussion
----------
[Console] Remove estimated field from debug_nomax
| Q | A
| ------------- | ---
| Bug fix? | yes
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Tests pass? | yes
| Fixed tickets | #11281
| License | MIT
| Doc PR |
Commits
-------
2ac1bb4
[Console] Remove estimated field from debug_nomax
This commit is contained in:
commit
7e1b4f6e2d
@ -547,13 +547,13 @@ class ProgressBar
|
||||
'normal_nomax' => ' %current% [%bar%]',
|
||||
|
||||
'verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%',
|
||||
'verbose_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%',
|
||||
'verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
|
||||
|
||||
'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%',
|
||||
'very_verbose_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%',
|
||||
'very_verbose' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s%',
|
||||
'very_verbose_nomax' => ' %current% [%bar%] %elapsed:6s%',
|
||||
|
||||
'debug' => ' %current%/%max% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
|
||||
'debug_nomax' => ' %current% [%bar%] %percent:3s%% %elapsed:6s%/%estimated:-6s% %memory:6s%',
|
||||
'debug_nomax' => ' %current% [%bar%] %elapsed:6s% %memory:6s%',
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -404,6 +404,34 @@ class ProgressBarTest extends \PHPUnit_Framework_TestCase
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dataProvider provideFormat
|
||||
*/
|
||||
public function testFormatsWithoutMax($format)
|
||||
{
|
||||
$bar = new ProgressBar($output = $this->getOutputStream());
|
||||
$bar->setFormat($format);
|
||||
$bar->start();
|
||||
|
||||
rewind($output->getStream());
|
||||
$this->assertNotEmpty(stream_get_contents($output->getStream()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Provides each defined format
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function provideFormat()
|
||||
{
|
||||
return array(
|
||||
array('normal'),
|
||||
array('verbose'),
|
||||
array('very_verbose'),
|
||||
array('debug'),
|
||||
);
|
||||
}
|
||||
|
||||
protected function getOutputStream($decorated = true)
|
||||
{
|
||||
return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated);
|
||||
|
Reference in New Issue
Block a user