From 36a389baeb4fb6ffdea674bdf58d7548ac8896f9 Mon Sep 17 00:00:00 2001 From: Tom Egan <61425509+tomegantcs@users.noreply.github.com> Date: Tue, 13 Dec 2022 14:05:13 -0500 Subject: [PATCH 1/2] Correct what appears to be intended behavior vs actual behavior in documentation When testing a command with an `InputOption::VALUE_NONE` option, and symfony/console v5.4.15 I have to provide a non-empty value to set the flag to the 'on' value. Perhaps this is changed in a later version? --- console.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/console.rst b/console.rst index 61418f6f039..f41c668f2ee 100644 --- a/console.rst +++ b/console.rst @@ -537,11 +537,11 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester`` .. caution:: - When testing ``InputOption::VALUE_NONE`` command options, you must pass an + When testing ``InputOption::VALUE_NONE`` command options, you must pass a non empty value to them:: $commandTester = new CommandTester($command); - $commandTester->execute(['--some-option' => '']); + $commandTester->execute(['--some-option' => 'true']); .. note:: From 4b93c00072e6b4a81ae349c0c7bf9a27f1220436 Mon Sep 17 00:00:00 2001 From: Tom Egan <61425509+tomegantcs@users.noreply.github.com> Date: Tue, 20 Feb 2024 07:55:41 -0500 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Wouter de Jong --- console.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/console.rst b/console.rst index f41c668f2ee..e8f49bc25fd 100644 --- a/console.rst +++ b/console.rst @@ -537,11 +537,11 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester`` .. caution:: - When testing ``InputOption::VALUE_NONE`` command options, you must pass a non - empty value to them:: + When testing ``InputOption::VALUE_NONE`` command options, you must pass ``true`` + to them:: $commandTester = new CommandTester($command); - $commandTester->execute(['--some-option' => 'true']); + $commandTester->execute(['--some-option' => true]); .. note::