- Issue created by @longwave
- ๐ฌ๐งUnited Kingdom longwave UK
Simplified both cases by moving the mocks into the test method and converting the data providers to generators.
I think providerTestRequiresEntityDataMigration() was buggy before as the "different storage class" was identical to the "same storage class" cases; changed this to use the test class itself as the "different storage class" and it still passes.
- Status changed to Needs review
8 months ago 10:31am 26 April 2024 - Status changed to RTBC
8 months ago 10:45am 26 April 2024 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
Looks good to me.
Returning associative arrays where the keys are the testโs methods argument names would make the dataproviders much more readble IMHO, but thatโs not for here.
- ๐ฌ๐งUnited Kingdom longwave UK
Yeah there is only so far I want to go here, although IIRC PHPUnit starts numbering test cases from 0 and the comments here number them from 1 which will make it slightly confusing if any of them fail...
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
No I donโt mean the name of the test case (that would be passed just after the yield before the arrow operator). I meant the name of the test argument being passed as key of the array yielded.
- ๐ฎ๐นItaly mondrake ๐ฎ๐น
- ๐ฌ๐งUnited Kingdom catch
Let's open a follow-up for that, seems worth recording but yeah I'm happy with what's in the MR here too.
- Status changed to Needs work
8 months ago 10:32pm 26 April 2024 - ๐บ๐ธUnited States xjm
FWIW it took me awhile to understand the refactor WRT the first parameters of the provider, but the result is definitely a lot cleaner.
- ๐ฌ๐งUnited Kingdom longwave UK
What is the scope of the followup? All data providers? Only data providers that use Boolean values? (I find those much harder to follow.usually) Or something else?
- ๐บ๐ธUnited States xjm
@longwave I think the scope of the followup is simply cleaning up this test, although we could also create a meta or coding standards issue for standardizing how data providers are written,
- Status changed to RTBC
8 months ago 5:00am 30 April 2024 - ๐ฎ๐นItaly mondrake ๐ฎ๐น
Follow-up is a coding standards discussion, #3443047: Coding Standards Meeting Wednesday 2024-05-08 0900 UTC โ , that was triggered by a suggestion to go in the opposite direction ie remove all keys, in #3442167-16: Fix string array keys in data sets returned by data provider methods that do not match the parameter names in Kernel tests โ .
- ๐ฌ๐งUnited Kingdom catch
Committed/pushed to 11.x and cherry-picked to 10.3.x, thanks!
- Status changed to Fixed
8 months ago 6:38am 30 April 2024 Automatically closed - issue fixed for 2 weeks with no activity.