-
Epic
-
Resolution: Unresolved
-
Minor
-
None
-
Future Dev
-
None
-
Prepare for PHPUnit 12+
This epic has been created to prepare for the next version of PHPUnit and any breaking changes that may be required.
Of particular note is that removal of support for Annotation as PHPUnit metadata. That is to say that metadata such as the following will no longer be respected:
- @dataProvider
- @requires
- @covers
- etc.
These have been replaced by the Attributes introduced in PHPUnit 10.
Since we have only upgraded from PHP 9.6 in Moodle 5.0 we have to be careful about how and when we perform the migration to PHPUnit 12 in core.
Moodle Version | PHPUnit Version | Supports Annotations | Supports Attributes | Supported PHP Versions | Support ends |
---|---|---|---|---|---|
Moodle 6.0 * | TBC | TBC | Yes | 8.4 - TBC | October 2030 |
Moodle 5.3 LTS * | TBC | TBC | Yes | 8.3 - TBC | April 2027 |
Moodle 5.2 * | TBC | TBC | Yes | 8.3 - TBC | October 2027 |
Moodle 5.1 * | TBC | TBC | Yes | 8.2 - 8.4 | April 2026 |
Moodle 5.0 | 11.4 | Yes | Yes | 8.2 - 8.4 | October 2026 |
Moodle 4.5 LTS | 9.6 | Yes | No | 8.1 - 8.3 | October 2027 |
Moodle 4.4 | 9.6 | Yes | No | 8.1 - 8.3 | December 2025 |
Moodle 4.3 | 9.5 | Yes | No | 8.0 - 8.2 | April 2025 |
Moodle 4.1 LTS | 9.5 | Yes | No | 7.4 - 8.1 | December 2025 |
PHPUnit 12 is due for release on February 7th 2025 and will require PHP 8.3 (dropping support for PHP 8.2).
PHPUnit 13 is probably expected in February 2026 and will require PHP 8.4 (dropping support for PHP 8.3).
Many of our community plugin developers still prefer to have a single branch of their plugin for all possible Moodle versions. Although we do recommend that there now be one branch per Series of Moodle, this is still not often adhered to.
We need to consider both our Deprecation Policy and our Support policies when deciding when to apply the PHPUnit 12 release. We also need to consider the risk of not upgrading PHPUnit regularly and the future impact and risk of leap-frogging PHPUnit versions.
Given all of the above, I would recommend:
- We upgrade to PHPUnit 12 for the Moodle 5.2 release due out in April 2026
- We convert the code codebase to process PHPUnit deprecations starting in Moodle 5.0 or possibly Moodle 5.1
- We recommend that any community plugin wishing to support versions older than 5.0 NOT process the Annotation deprecations
- is blocked by
-
MDL-80969 Upgrade from PHPUnit 9
-
- Closed
-