Skip to content

Commit b79b9cf

Browse files
committed
Refactoring example code for the dialog helper command test
1 parent 5ac4466 commit b79b9cf

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

components/console/helpers/dialoghelper.rst

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,11 @@ from the command line, you need to overwrite the HelperSet used by the command::
114114
// ...
115115
$commandTester = new CommandTester($command);
116116
117-
$dialog = new DialogHelper();
117+
$dialog = $command->getHelper('dialog');
118118
$dialog->setInputStream($this->getInputStream('Test\n'));
119119
// Equals to a user inputing "Test" and hitting ENTER
120120
// If you need to enter a confirmation, "yes\n" will work
121121
122-
$command->setHelperSet(new HelperSet(array($dialog)));
123-
124122
$commandTester->execute(array('command' => $command->getName()));
125123
126124
// $this->assertRegExp('/.../', $commandTester->getDisplay());

0 commit comments

Comments
 (0)