From b2131ceff74da4c23928936f238d676a08e07d7f Mon Sep 17 00:00:00 2001 From: "Eloy Lafuente (stronk7)" Date: Mon, 25 Mar 2024 11:45:09 +0100 Subject: [PATCH] MDL-81266 phpunit: Document the changes in lib/upgrade.txt --- lib/upgrade.txt | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/lib/upgrade.txt b/lib/upgrade.txt index d94d7131981..5104d9177bf 100644 --- a/lib/upgrade.txt +++ b/lib/upgrade.txt @@ -99,6 +99,43 @@ information provided here is intended especially for developers. to bool if the original functionality is desired. * core\hook\manager::phpunit_get_instance() now sets self::$instance to the mocked instance if the optional $persist argument is true, so future calls to ::get_instance() will return it. +* PHPUnit has been upgraded to 9.6 (see MDL-81266 for details). + The main goal of the update is to allow developers to know in advance, + via deprecations, which stuff is going to stop working (because of being removed) + with PHPUnit 10 (see MDL-80969 for details). Other than that, the changes are minimal. + This is the list of noticeable changes: + - Deprecation: MDL-81281. A number of attribute-related assertions have been deprecated, will + be removed with PHPUnit 10. Alternatives for *some* of them are available: + - assertClassHasAttribute() + - assertClassNotHasAttribute() + - assertClassHasStaticAttribute() + - assertClassNotHasStaticAttribute() + - assertObjectHasAttribute() => assertObjectHasProperty() + - assertObjectNotHasAttribute() => assertObjectNotHasProperty() + - Deprecation: MDL-81266. A number of deprecation/notice/warning/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. + - expectDeprecation() + - expectDeprecationMessage() + - expectDeprecationMessageMatches() + - expectError() + - expectErrorMessage() + - expectErrorMessageMatches() + - expectNotice() + - expectNoticeMessage() + - expectNoticeMessageMatches() + - expectWarning() + - expectWarningMessage() + - expectWarningMessageMatches() + - Deprecation: MDL-81308. 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. + - Deprecation: 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. + - Deprecation: Cannot use the "Test" suffix on abstract test case classes. Proceed to + rename them to end with "TestCase" instead. === 4.3 ===