-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Added TestData attribute with named data sets and variadic parameter support #5167
Conversation
I have a few open questions:
|
Good, as no new annotations will be added to PHPUnit. |
Please consider an alternative. |
I think we do not need a new |
I do not think so, at least not for now. |
Codecov Report
@@ Coverage Diff @@
## main #5167 +/- ##
============================================
- Coverage 81.24% 81.18% -0.06%
- Complexity 5827 5844 +17
============================================
Files 629 631 +2
Lines 18459 18499 +40
============================================
+ Hits 14997 15019 +22
- Misses 3462 3480 +18
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
Thanks for the feedback! Looking to xUnit and NUnit for inspiration, it looks like xUnit does not support named data sets in their
I can implement a PR for any of these approaches, but wanted to get your input first. |
@sebastianbergmann Did you have any preference on my list of proposed ways forward above? |
Hi @sebastianbergmann, have you had an opportunity to review the different options I enumerated above? Do any sound preferable to you? Or should I abandon this feature altogether? Thanks! |
The more I think about this, the more I think that things should stay as they are. Sorry. |
This is meant to simplify how inline test data is passed into tests. Rather than requiring everything to be wrapped in an array like
You can now just pass in the parameters directly using the new
#[TestData]
attribute:which looks more like an invocation of the test method. Additionally, this PR introduces support for naming data sets using a
name
parameter, egI have purposely not created an annotation version of this because PHPDoc is not a good place to define PHP values to pass into test methods.