- π¦πΊAustralia mstrelan
In PHPUnit 11 we'll need to use the
#[DataProvider]
attribute. Not sure we need to enforce any particular naming convention if we have this. - πΊπΈUnited States xjm
In π Rename mis-named data providers discovered in #3421418 Postponed , we also noticed a few data providers that were named
testSomethingSomethingProvider()
, rather than the more commonproviderTestSomethingSomething()
. It might be worth having an explicit standard about the naming, especially since the pattern of those three methods made it look like they were test methods themselves rather than data providers. (I don't know if PHPUnit actually tries to run them, but it is confusing.) Added to the IS. - πΊπΈUnited States xjm
As I mentioned on the other issue, I also am not sure if lumping naming with documentation expectations is correct. It should possibly be separate issues.
- π¦πΊAustralia mstrelan
The issue title "Discuss the standards for data providers in PHPUnit-based tests" to me suggests a holistic approach. Happy for someone else to split it in to multiple tickets, but it makes sense to me to discuss it as a whole in this issue and split off once concrete decisions are made.
- π³πΏNew Zealand quietone
Moved the naming work to π Define a standard for naming data providers in PHPUnit-based tests Active
- π¬π§United Kingdom joachim
> However, if we mandate that every set of arguments is keyed by a meaningful string then this is super useful.
That is super useful, but it's code, not documentation. Out of scope for this issue?
> If we follow the core standards of documenting @return and @param tests will have a lot of boilerplate that does not add much.
Documenting both the @return of the provider and the @params of the tests is writing the same thing twice, and redundant, but *one* of them should be documented!