From 26a7fab00b831cab5beb8c90ccd0f206020f08cf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Halin?= Date: Tue, 4 Oct 2022 16:14:27 +0200 Subject: [PATCH] docs(console): add caution for testing option Add a caution about `InputOption::VALUE_NONE` testing. Passing only a value without a key doesn't work and can lead to misunderstanding. --- console.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/console.rst b/console.rst index 9dd9cecddb4..ed7ff754c78 100644 --- a/console.rst +++ b/console.rst @@ -546,6 +546,15 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester`` $application->setAutoExit(false); $tester = new ApplicationTester($application); + + +.. caution:: + + When testing ``InputOption::VALUE_NONE`` command option, be sure to pass an empty + value like so:: + + $commandTester = new CommandTester($command); + $commandTester->execute(['--some-option' => '']); .. note::