Skip to content

Commit 26a7fab

Browse files
jeremyhalinjaviereguiluz
authored andcommitted
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.
1 parent 6f72b56 commit 26a7fab

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

console.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,15 @@ call ``setAutoExit(false)`` on it to get the command result in ``CommandTester``
546546
$application->setAutoExit(false);
547547

548548
$tester = new ApplicationTester($application);
549+
550+
551+
.. caution::
552+
553+
When testing ``InputOption::VALUE_NONE`` command option, be sure to pass an empty
554+
value like so::
555+
556+
$commandTester = new CommandTester($command);
557+
$commandTester->execute(['--some-option' => '']);
549558

550559
.. note::
551560

0 commit comments

Comments
 (0)