[meta] Add return typehinting to the test codebase

Created on 18 June 2024, 5 months ago
Updated 24 June 2024, 5 months ago

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

  1. 📌 Add void return typehints to all test methods Active
  2. 🌱 Add return typehints to protected test helper methods Active
  3. 📌 Add appropriate return typehints to all @dataProvider methods Active
  4. Decide how to handle test fixtures, both within and outside of test class files. (Probably merits its own child meta.)
  5. Children being added as various followups to the above.
  6. Enable SlevomatCodingStandard.TypeHints.ReturnTypeHint phpcs code sniff on */tests/*

API changes

Return typehints on methods in test code.

Release notes snippet

Maybe?

🌱 Plan
Status

Active

Version

11.0 🔥

Component
PHPUnit 

Last updated about 2 hours ago

Created by

🇺🇸United States xjm

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024