-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Console] Add support for Invokable Commands in CommandTester
#60823
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
base: 7.4
Are you sure you want to change the base?
Conversation
CommandTester
and Application
Sure I could wrap them manually in |
I updated the target branch to 7.4, this is a new feature that cannot be merged into 7.3 |
2e104a7
to
beea196
Compare
Thanks, it seems that the Application was already fixed in 7.4 #60394 |
CommandTester
and Application
CommandTester
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's good, there are a few things to fix to clean up the PR.
Thanks for the new test.
beea196
to
74ca920
Compare
@GromNaN Done, also updated the changelog! |
47ff4cc
to
e1d9dce
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the update! I found the source of the bug and added a new suggestion for the constructor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test needs to be modified, and then we're all good!
src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php
Outdated
Show resolved
Hide resolved
src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php
Outdated
Show resolved
Hide resolved
@GromNaN Done, I also added another commit with extra tests. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ruudk for the improvement!
src/Symfony/Component/Console/Tests/Tester/CommandTesterTest.php
Outdated
Show resolved
Hide resolved
40a5a5f
to
a10ae7f
Compare
I'm trying out the amazing new Invokable Commands introduced in Symfony 7.3 but I noticed that I could use it together with the CommandTester. It was also not possible to manually add these type of commands to the Application.
I'm not sure what the best approach is with this. As I'm changing the signature of the methods this might be considered a breaking change. Or it might not, as I'm widening the type from Command to object.
Please advise what the best approach would be to introduce something like this. Thanks 🙏
/cc @yceruto @chalasr