8000 bug #19923 [bugfix] [Console] Set `Input::$interactive` to `false` wh… · jeremyFreeAgent/symfony@c1cc6ca · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit c1cc6ca

Browse files
committed
bug symfony#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|symfony#19899| |License |MIT | |Doc PR |n/a | Closes symfony#19899. Commits ------- 4214311 [bugfix] [Console] Set `Input::$interactive` to `false` when command is executed with `--quiet` as verbosity level
2 parents ce73768 + 4214311 commit c1cc6ca

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/Symfony/Component/Console/Application.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ public function register($name)
337337
* Adds an array of command objects.
338338
*
339339
* If a Command is not enabled it will not be added.
340-
*
340+
*
341341
* @param Command[] $commands An array of commands
342342
*/
343343
public function addCommands(array $commands)
@@ -808,6 +808,7 @@ protected function configureIO(InputInterface $input, OutputInterface $output)
808808

809809
if (true === $input->hasParameterOption(array('--quiet', '-q'))) {
810810
$output->setVerbosity(OutputInterface::VERBOSITY_QUIET);
811+
$input->setInteractive(false);
811812
} else {
812813
if ($input->hasParameterOption('-vvv') || $input->hasParameterOption('--verbose=3') || $input->getParameterOption('--verbose') === 3) {
813814
$output->setVerbosity(OutputInterface::VERBOSITY_DEBUG);

src/Symfony/Component/Console/Tests/ApplicationTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,9 +636,11 @@ public function testRun()
636636

637637
$tester->run(array('command' => 'list', '--quiet' => true));
638638
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if --quiet is passed');
639+
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if --quiet is passed');
639640

640641
$tester->run(array('command' => 'list', '-q' => true));
641642
$this->assertSame('', $tester->getDisplay(), '->run() removes all output if -q is passed');
643+
$this->assertFalse($tester->getInput()->isInteractive(), '->run() sets off the interactive mode if -q is passed');
642644

643645
$tester->run(array('command' => 'list', '--verbose' => true));
644646
$this->assertSame(Output::VERBOSITY_VERBOSE, $tester->getOutput()->getVerbosity(), '->run() sets the output to verbose if --verbose is passed');

0 commit comments

Comments
 (0)
0