Skip to content

Commit 77f4920

Browse files
committed
[Console] Mention how to test a multiline question’s answer
1 parent b29856d commit 77f4920

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
@@ -545,6 +545,14 @@ from the command line, you need to set the inputs that the command expects::
545545
// additional input saying "yes" will work
546546
$commandTester->setInputs(['yes']);
547547

548+
// Answers to multiline questions need to be suffixed by
549+
// an end-of-transmission control character
550+
$commandTester->setInputs([<<<INPUT
551+
First line
552+
Second line
553+
\x04
554+
INPUT]);
555+
548556
$commandTester->execute(['command' => $command->getName()]);
549557

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

0 commit comments

Comments
 (0)