Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Refactoring example code for the dialog helper command test

  • Loading branch information...
commit b79b9cf7b9c1e09b39a8cfb1df71456c0c261cf0 1 parent 5ac4466
@Sgoettschkes authored
Showing with 1 addition and 3 deletions.
  1. +1 −3 components/console/helpers/dialoghelper.rst
View
4 components/console/helpers/dialoghelper.rst
@@ -114,13 +114,11 @@ from the command line, you need to overwrite the HelperSet used by the command::
// ...
$commandTester = new CommandTester($command);
- $dialog = new DialogHelper();
+ $dialog = $command->getHelper('dialog');
$dialog->setInputStream($this->getInputStream('Test\n'));
// Equals to a user inputing "Test" and hitting ENTER
// If you need to enter a confirmation, "yes\n" will work
- $command->setHelperSet(new HelperSet(array($dialog)));
-
$commandTester->execute(array('command' => $command->getName()));
// $this->assertRegExp('/.../', $commandTester->getDisplay());
Please sign in to comment.
Something went wrong with that request. Please try again.