Problem/Motivation
Among our efforts to add strict typing to core, tests are good early targets, because the majority of test code is internal API.
Proposed resolution
Add return typehints to the test codebase, first where non-disruptive, then where possibly disruptive (base classes, traits, etc.).
Remaining tasks
- #3421418: [May 2024] Add void return typehints to all test methods
- #3455549: Add return typehints to protected test helper methods
- #3421417: Add appropriate return typehints to all @dataProvider methods
- Decide how to handle test fixtures, both within and outside of test class files. (Probably merits its own child meta.)
- Children being added as various followups to the above.
- Enable
SlevomatCodingStandard.TypeHints.ReturnTypeHintphpcs code sniff on */tests/*
API changes
Return typehints on methods in test code.
Release notes snippet
Maybe?
Comments
Comment #2
xjmComment #3
xjmComment #4
mstrelan commented