-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] How provide input stream for ApplicationTester? #24784
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
Did you check https://symfony.com/doc/current/components/console/helpers/questionhelper.html#testing-a-command-that-expects-input ? Does it solve your problem? |
@dmaicher, Yes, I did. It works fine with command tester. I need the same for application tester. |
There's no reason to not be able to do the same using the application tester. |
@Chi-teck Do you want to provide the PR ? |
@Simperfit, I can't work on this at the moment. Feel free to submit the PR if you want. |
I'm gonna do it. |
… some code (Simperfit) This PR was merged into the 4.1-dev branch. Discussion ---------- [Console] add setInputs to ApplicationTester and share some code | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | yes | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #24784 | License | MIT | Doc PR | todo I didn't implemented the tests because I don't know how to write them on ApplicationTester. Commits ------- ea86ed8 [Console] add setInputs to ApplicationTest and share some code
I am using the following code to test interactive console application.
It works well but it is not compatible with Symfony 4 because setInputStream() method has been removed.
The documentation suggests using StreamableInputInterface::setStream() but I could not find any way to set Input for ApplicationTester.
Any suggestions?
The text was updated successfully, but these errors were encountered: