-
-
Notifications
You must be signed in to change notification settings - Fork 5.2k
[Cookbook] Example shown doesn't work for unit testing ConsoleCommand #2870
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
What exactly does not work without this line? Do you get any errors? |
I get exceptions from the Input.php class that a required argument is missing. It also differs from this doc that seems to have the correct example: http://symfony.com/doc/current/components/console/introduction.html#testing-commands
|
It was removed quite recently in 16e5577 If I remember correctly, you get indeed errors when you are missing the Let's put the 2 removed lines (see commit) back! |
The problem for me is that I can't reproduce this errors, not even on a fresh 2.3 installation. |
I created a gist: https://gist.github.com/WouterJ/6129648 Without |
This seems to be a bug. If you create a Command that has arguments, everything is fine. Additionally, it even doesn't matter which value you pass for the |
Was about to open an issue for this problem then found this. Bumped also the other issue for the bug. |
@gena01 can you confirm that this problem has been fixed with symfony/symfony@50c8050? |
Actually, symfony/symfony@50c8050 won't be merged into |
… in the CommandTester
The section here has a typo:
http://symfony.com/doc/current/cookbook/console/console_command.html#testing-commands
Seems like adding another line:
'command' => $command->getName(),
before the name key fixes the issue for me.
The text was updated successfully, but these errors were encountered: