Skip to content

Commit db3c403

Browse files
committed
Merge branch '6.4' into 7.3
* 6.4: Minor tweaks [Console] Mention how to test a multiline question’s answer
2 parents 685b3ac + 1bfe811 commit db3c403

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

components/console/helpers/questionhelper.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,14 @@ from the command line, you need to set the inputs that the command expects::
543543
// additional input saying "yes" will work
544544
$commandTester->setInputs(['yes']);
545545

546+
// \x04 is the End of Transmission (EOT) control character,
547+
// required to mark the end of input when the answer contains \n characters
548+
$commandTester->setInputs([<<<INPUT
549+
First line
550+
Second line
551+
\x04
552+
INPUT]);
553+
546554
$commandTester->execute(['command' => $command->getName()]);
547555

548556
// $this->assertRegExp('/.../', $commandTester->getDisplay());

0 commit comments

Comments
 (0)