-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unit test classes should be declared as either final or abstract #103
Unit test classes should be declared as either final or abstract #103
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #103 +/- ##
============================================
+ Coverage 96.57% 96.73% +0.16%
- Complexity 557 586 +29
============================================
Files 24 26 +2
Lines 1547 1625 +78
============================================
+ Hits 1494 1572 +78
Misses 53 53 ☔ View full report in Codecov by Sentry. |
48641b1
to
ec33ecb
Compare
ec33ecb
to
c49ee0e
Compare
Apart from the detail in the review, surely the major "problem" of this nice Sniff is to determine how do we apply it (only for X.Y and up, warning and error in 1-year, only for non-plugins, ...). As far as it's not part of the coding-style neither enforced by PHPUnit incoming versions... we need to be careful about it (back to the discussion happening @ #92). Ciao :-) |
c49ee0e
to
74f10d4
Compare
Okay, I've:
I think we need to add this to the epic for PHPUnit 10 as a part of that puzzle and add it to our coding style. This isn't something radical. |
74f10d4
to
776f92a
Compare
For fixtures...
or
I've been doing the later lately and it seems that you've been doing the former. Of course, there are still a lot of fixtures to move so, at some time, we should decide which of the 2 fixtures dirs to use and go for it everywhere (for testing own Sniffs, other standards sniffs are another story). |
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 final question in the review here is... do we want this to start warning now, with 4.4dev? Or want it for the next one?
I've been doing the former because it keeps the fixtures closer to the thing under test, and makes them easier to find, but I'm happy to move them. Let me know your preference. |
776f92a
to
102401f
Compare
Yeah, I think I agree with you, let's keep the fixtures closer to the the Test using them, specially now that we are creating subdirs for the tests. Not in a hurry to move all current ones that have followed other paths, but let's go with your alternative for new ones. |
So, just to be 100% sure, as commented above:
I'm happy with that (4.4dev), will generate some noise for plugins, but it's a good thing, I think. And prepares us for the future, together with #106 and other details that have arrived recently (static providers, ....). So, with your 👍 , agreement! |
102401f
to
b8f9eee
Compare
Sold! |
The base dir for the tests must be Tests/Util and all its fixtures must be together in Tests/Util/fixtures dir. Agreed @ moodlehq#103 (comment)
Fixes #102
The rationale for this change is based on the principle of least astonishment.
To solve this the idea is: