bug #19923 [bugfix] [Console] Set Input::$interactive
to false
when command is executed with --quiet
as verbosity level (phansys)
This PR was merged into the 2.7 branch.
Discussion
----------
[bugfix] [Console] Set `Input::$interactive` to `false` when command is executed with `--quiet` as verbosity level
|Q |A |
|--- |--- |
|Branch |2.7 |
|Bug fix? |yes |
|New feature? |no |
|BC breaks? |yes |
|Deprecations?|no |
|Tests pass? |yes |
|Fixed tickets|#19899|
|License |MIT |
|Doc PR |n/a |
Closes #19899.
Commits
-------
4214311
[bugfix] [Console] Set `Input::$interactive` to `false` when command is executed with `--quiet` as verbosity level
This commit is contained in:
commit
c1cc6ca40e
@ -808,6 +808,7 @@ class Application
|
|||||||
|
|
||||||
if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
|
if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
|
||||||
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
|
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
|
||||||
|
$input->setInteractive(false);
|
||||||
} else {
|
} else {
|
||||||
if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) {
|
if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) {
|
||||||
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
|
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);
|
||||||
|
@ -636,9 +636,11 @@ class ApplicationTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$tester->run(array('command' => 'list', '--quiet' => true));
|
$tester->run(array('command' => 'list', '--quiet' => true));
|
||||||
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
|
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
|
||||||
|
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed');
|
||||||
|
|
||||||
$tester->run(array('command' => 'list', '-q' => true));
|
$tester->run(array('command' => 'list', '-q' => true));
|
||||||
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
|
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
|
||||||
|
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed');
|
||||||
|
|
||||||
$tester->run(array('command' => 'list', '--verbose' => true));
|
$tester->run(array('command' => 'list', '--verbose' => true));
|
||||||
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
|
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');
|
||||||
|
Reference in New Issue
Block a user