Skip to content

Commit cf22f07

Browse files
authored
Merge pull request #933 from stronk7/phpunit96
MDL-81266: documentation related to the PHPUnit 9.6 update
2 parents deb6512 + 778ef6f commit cf22f07

File tree

2 files changed

+38
-1
lines changed

2 files changed

+38
-1
lines changed

docs/devupdate.md

+36
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,42 @@ function h5pactivity_is_branded(): bool {
549549
}
550550
```
551551

552+
## PHPUnit 9.6 update
553+
554+
<Since version="4.4" issueNumber="MDL-81266" />
555+
556+
### Intention
557+
558+
The main goal of this minor update, from **PHPUnit 9.5 to 9.6**, is to start informing to developers in advance about the functionality that has been deprecated in the 9.x series and will be removed completely with the next PHPUnit 10.x update.
559+
560+
### Deprecated stuff
561+
562+
Here you can find all the functionality that has been deprecated in PHPUnit 9.x and needs to be fixed, converted or removed in order to allow the tests to continue working once Moodle gets upgraded to PHPUnit 10.x:
563+
564+
- A number of attribute-related assertions have been deprecated, will be removed with PHPUnit 10. Alternatives for *some* of them are available (Ref. MDL-81281):
565+
- `assertClassHasAttribute()`
566+
- `assertClassNotHasAttribute()`
567+
- `assertClassHasStaticAttribute()`
568+
- `assertClassNotHasStaticAttribute()`
569+
- `assertObjectHasAttribute()` => `assertObjectHasProperty()`
570+
- `assertObjectNotHasAttribute()` => `assertObjectNotHasProperty()`
571+
- A number of deprecation, notice, warning and error expectations have been deprecated, will be removed with PHPUnit 10. No alternative exists. A working replacement is available in the linked issue, hopefully there aren't many cases (Ref. MDL-81266):
572+
- `expectDeprecation()`
573+
- `expectDeprecationMessage()`
574+
- `expectDeprecationMessageMatches()`
575+
- `expectError()`
576+
- `expectErrorMessage()`
577+
- `expectErrorMessageMatches()`
578+
- `expectNotice()`
579+
- `expectNoticeMessage()`
580+
- `expectNoticeMessageMatches()`
581+
- `expectWarning()`
582+
- `expectWarningMessage()`
583+
- `expectWarningMessageMatches()`
584+
- The `->withConsecutive()` functionality on PHPUnit mocks has been **silently** deprecated, will be removed with PHPUnit 10. Note that this won't affect PHPUnit 9.6 runs and an alternative path will be proposed in the linked issue, part of the PHPUnit 10 epic (Ref. MDL-81308).
585+
- `PHPUnit\Framework\TestCase::getMockClass()` has been deprecated, will be removed with PHPUnit 10. No clear alternative exists and won't be investigated, because there aren't cases in core.
586+
- Cannot use the `Test` suffix on abstract test case classes anymore. Proceed to rename them to end with `TestCase` instead.
587+
552588
## Previous versions
553589

554590
- [Moodle 4.3 developer update](./4.3/devupdate)

general/development/tools/phpunit.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ The following table shows what PHPUnit version is installed in which Moodle vers
5555

5656
| Moodle version | PHPUnit version | Links |
5757
| --- | --- |---------------------------------------------------------|
58-
| Moodle 3.11 - 4.0 | PHPUnit 9.5 | [Documentation](https://docs.phpunit.de/en/9.6/) |
58+
| Moodle 4.4 | PHPUnit 9.6 | [Documentation](https://docs.phpunit.de/en/9.6/) |
59+
| Moodle 3.11 - 4.3 | PHPUnit 9.5 | [Documentation](https://docs.phpunit.de/en/9.6/) |
5960
| Moodle 3.10 | PHPUnit 8.5 | [Documentation](https://docs.phpunit.de/en/8.5/) |
6061
| Moodle 3.7 - 3.9 | PHPUnit 7.5 | [Documentation](https://docs.phpunit.de/en/7.5/) |
6162
| Moodle 3.4 - 3.6 | PHPUnit 6.5 | [Documentation](https://phpunit.de/manual/6.5/en/) |

0 commit comments

Comments
 (0)