Page MenuHomePhabricator

Upgrade to PHPUnit 9.6
Closed, ResolvedPublic

Description

MW core (and probably most libraries) are currently using PHPUnit 9.5. The 9.6 version had some of the deprecations from PHPUnit 10 backported, as can be seen in the changelog. Here's an excerpt:

#5160: Deprecate assertClassHasAttribute(), assertClassNotHasAttribute(), assertClassHasStaticAttribute(), assertClassNotHasStaticAttribute(), assertObjectHasAttribute(), assertObjectNotHasAttribute(), classHasAttribute(), classHasStaticAttribute(), and objectHasAttribute()
#5062: Deprecate expectDeprecation(), expectDeprecationMessage(), expectDeprecationMessageMatches(), expectError(), expectErrorMessage(), expectErrorMessageMatches(), expectNotice(), expectNoticeMessage(), expectNoticeMessageMatches(), expectWarning(), expectWarningMessage(), and expectWarningMessageMatches()
#5063: Deprecate withConsecutive()
#5064: Deprecate PHPUnit\Framework\TestCase::getMockClass()
#5132: Deprecate Test suffix for abstract test case classes

We won't be able to update to PHPUnit 10 (T328919) for a long time due to its requirement of PHP >= 8.1. Therefore, I think it would make sense to address these deprecations now, so that the upgrade to PHPUnit 10 will be easier once the PHP requirement is fulfilled.


Codesearches

Details

SubjectRepoBranchLines +/-
mediawiki/coremaster+2 -1
mediawiki/vendormaster+2 K -1 K
mediawiki/extensions/Wikibasemaster+46 -23
mediawiki/extensions/WikispeechSpeechDataCollectormaster+31 -29
mediawiki/extensions/BlueSpiceFoundationmaster+1 -1
mediawiki/coremaster+2 -25
mediawiki/extensions/Checklistsmaster+17 -12
mediawiki/extensions/ContentStabilizationmaster+74 -44
mediawiki/extensions/LDAPSyncAllmaster+6 -3
mediawiki/extensions/BlueSpiceBookshelfmaster+8 -8
mediawiki/extensions/Wikibasemaster+8 -2
mediawiki/extensions/WikimediaEventsmaster+7 -3
mediawiki/coremaster+3 -3
mediawiki/coremaster+192 -79
mediawiki/extensions/Mathmaster+12 -4
mediawiki/extensions/Wikibasemaster+22 -18
mediawiki/coremaster+2 -1
mediawiki/coremaster+2 -39
mediawiki/tools/phan/PerfCheckPluginmaster+1 -1
mediawiki/coremaster+1 K -1 K
mediawiki/vendormaster+153 -211
labs/libraryupgrader/configmaster+1 -1
mediawiki/oauthclient-phpmaster+2 -2
mediawiki/libs/Servicesmaster+1 -1
mediawiki/libs/Shellboxmaster+228 -209
css-sanitizermaster+7 -10
mediawiki/services/parsoidmaster+1 -1
php-session-serializermaster+1 -1
testing-access-wrappermaster+1 -1
mediawiki/tools/phan/SecurityCheckPluginmaster+1 -1
mediawiki/tools/phpunit-patch-coveragemaster+1 -1
mediawiki/tools/codesniffermaster+1 -1
mediawiki/libs/aleamaster+1 -1
mediawiki/libs/php-cssjanusmaster+1 -1
mediawiki/libs/less.phpmaster+1 -1
mediawiki/libs/XMPReadermaster+1 -1
mediawiki/libs/Zestmaster+1 -1
mediawiki/libs/WebIDLmain+1 -1
mediawiki/libs/Timestampmaster+1 -1
mediawiki/libs/WaitConditionLoopmaster+1 -1
mediawiki/libs/ScopedCallbackmaster+1 -1
mediawiki/libs/RemexHtmlmaster+1 -1
mediawiki/libs/RequestTimeoutmaster+1 -1
mediawiki/libs/ObjectFactorymaster+1 -1
mediawiki/libs/NormalizedExceptionmaster+1 -1
mediawiki/libs/Minifymaster+1 -1
mediawiki/libs/LangConvmaster+1 -1
mediawiki/libs/JsonCodecmain+1 -1
mediawiki/libs/Dodomaster+1 -1
mediawiki/libs/IPUtilsmaster+1 -1
mediawiki/libs/IDLeDOMmain+1 -1
mediawiki/libs/IPAValidatormain+1 -1
mediawiki/libs/CommonPasswordsmaster+1 -1
mediawiki/libs/CloverDiffmaster+1 -1
mediawiki/libs/Equivsetmaster+1 -1
mediawiki/libs/Bcp47Codemain+1 -1
mediawiki/libs/Assertmaster+1 -1
wikipegmaster+1 -1
cdbmaster+1 -1
WrappedStringmaster+1 -1
base-convertmaster+1 -1
at-easemaster+1 -1
RelPathmaster+1 -1
oojs/uimaster+1 -1
RunningStatmaster+1 -1
operations/mediawiki-configmaster+45 -41
AhoCorasickmaster+1 -1
purtlemaster+1 -1
CLDRPluralRuleParsermaster+1 -1
IPSetmaster+1 -1
mediawiki/tools/phanmaster+1 -1
HtmlFormattermaster+1 -1
integration/docrootmaster+1 -1
mediawiki/extensions/MathSearchmaster+1 -1
mediawiki/extensions/MediaModerationmaster+32 -21
mediawiki/extensions/MenuEditormaster+3 -3
mediawiki/coremaster+74 -40
mediawiki/extensions/GrowthExperimentsmaster+1 -1
mediawiki/extensions/Quizmaster+0 -4
mediawiki/coremaster+21 -21
mediawiki/extensions/Cognatemaster+12 -11
mediawiki/extensions/Mailgunmaster+10 -4
mediawiki/extensions/CodeMirrormaster+7 -1
mediawiki/extensions/ExternalDatamaster+17 -53
mediawiki/coremaster+33 -22
mediawiki/extensions/Wikibasemaster+152 -74
mediawiki/extensions/CheckUsermaster+112 -107
mediawiki/extensions/Popupsmaster+18 -14
mediawiki/extensions/ImageSuggestionsmaster+7 -3
mediawiki/extensions/ChessBrowsermaster+20 -35
mediawiki/extensions/Newslettermaster+18 -12
mediawiki/extensions/PageImagesmaster+14 -12
mediawiki/extensions/Wikispeechmaster+28 -30
mediawiki/extensions/WikiLambdamaster+8 -10
mediawiki/extensions/GrowthExperimentsmaster+38 -40
mediawiki/extensions/ReportIncidentmaster+6 -12
mediawiki/extensions/WikibaseQualityConstraintsmaster+45 -44
mediawiki/extensions/WikibaseLexemeCirrusSearchmaster+5 -5
mediawiki/extensions/CentralAuthmaster+4 -4
mediawiki/extensions/OAuthmaster+6 -6
mediawiki/extensions/Wikibasemaster+88 -87
mediawiki/extensions/WikibaseLexememaster+9 -5
mediawiki/extensions/WikibaseCirrusSearchmaster+20 -12
mediawiki/extensions/GlobalWatchlistmaster+4 -10
mediawiki/extensions/Scribuntomaster+5 -5
mediawiki/extensions/Echomaster+40 -40
mediawiki/extensions/Citemaster+20 -15
mediawiki/extensions/WikibaseMediaInfomaster+3 -3
mediawiki/extensions/CirrusSearchmaster+27 -26
mediawiki/coremaster+29 -4
mediawiki/coremaster+21 -26
Show related patches Customize query in gerrit

Related Objects

StatusSubtypeAssignedTask
StalledNone
OpenNone
ResolvedDaimona

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

Change 994316 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/tools/codesniffer@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994316

Change 994313 merged by jenkins-bot:

[integration/docroot@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994313

Change 994312 merged by jenkins-bot:

[mediawiki/libs/alea@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994312

Change 994317 had a related patch set uploaded (by Jforrester; author: Jforrester):

[operations/mediawiki-config@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994317

Change 994318 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/tools/phan/PerfCheckPlugin@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994318

Change 994319 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/tools/phan/SecurityCheckPlugin@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994319

Change 994320 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/tools/phpunit-patch-coverage@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994320

Change 994322 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/services/parsoid@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994322

Change 994316 merged by jenkins-bot:

[mediawiki/tools/codesniffer@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994316

Change 994315 merged by jenkins-bot:

[mediawiki/tools/phan@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994315

Change 994318 merged by jenkins-bot:

[mediawiki/tools/phan/PerfCheckPlugin@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994318

Change 994323 had a related patch set uploaded (by Jforrester; author: Jforrester):

[testing-access-wrapper@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994323

Change 994324 had a related patch set uploaded (by Jforrester; author: Jforrester):

[php-session-serializer@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994324

Change 994320 merged by jenkins-bot:

[mediawiki/tools/phpunit-patch-coverage@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994320

Change 994326 had a related patch set uploaded (by Jforrester; author: Jforrester):

[wikipeg@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994326

Change 994317 merged by jenkins-bot:

[operations/mediawiki-config@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994317

Change 994319 merged by jenkins-bot:

[mediawiki/tools/phan/SecurityCheckPlugin@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994319

Change 994323 merged by jenkins-bot:

[testing-access-wrapper@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994323

Change 994324 merged by jenkins-bot:

[php-session-serializer@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994324

Change 994326 merged by jenkins-bot:

[wikipeg@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994326

Change 994327 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994327

Change 994322 merged by jenkins-bot:

[mediawiki/services/parsoid@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994322

Change 994303 merged by jenkins-bot:

[mediawiki/libs/Shellbox@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994303

Change 994285 merged by jenkins-bot:

[css-sanitizer@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994285

Change 994726 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/oauthclient-php@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994726

Change 994728 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/libs/Services@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994728

Change 994728 merged by jenkins-bot:

[mediawiki/libs/Services@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994728

Change 994726 merged by jenkins-bot:

[mediawiki/oauthclient-php@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994726

Change 995262 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[labs/libraryupgrader/config@master] Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/995262

Change 995262 merged by jenkins-bot:

[labs/libraryupgrader/config@master] Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/995262

Change 997591 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.19.0-a16

https://gerrit.wikimedia.org/r/997591

Change 997591 merged by jenkins-bot:

[mediawiki/vendor@master] Bump wikimedia/parsoid to 0.19.0-a16

https://gerrit.wikimedia.org/r/997591

Change 998536 had a related patch set uploaded (by VolkerE; author: VolkerE):

[mediawiki/core@master] Update OOUI to v0.49.0

https://gerrit.wikimedia.org/r/998536

Change 998536 merged by jenkins-bot:

[mediawiki/core@master] Update OOUI to v0.49.0

https://gerrit.wikimedia.org/r/998536

Change 1003087 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/core@master] CommentFormatter: Clean up CommentParserFactoryTest

https://gerrit.wikimedia.org/r/1003087

Change 1003087 merged by jenkins-bot:

[mediawiki/core@master] CommentFormatter: Clean up CommentParserFactoryTest

https://gerrit.wikimedia.org/r/1003087

Change 1004228 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/core@master] build: Upgrade PHPUnit from 9.5.28 to 9.6.16

https://gerrit.wikimedia.org/r/1004228

Change 1004228 abandoned by Jforrester:

[mediawiki/core@master] build: Upgrade PHPUnit from 9.5.28 to 9.6.16

Reason:

Ha, already did this in d708a7716505ffce26c8eb438a98d74195682e91.

https://gerrit.wikimedia.org/r/1004228

Change 1005845 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/extensions/Wikibase@master] Avoid abstract PHPUnit test classes, fix autoloading

https://gerrit.wikimedia.org/r/1005845

Change 1005845 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] Avoid abstract PHPUnit test classes, fix autoloading

https://gerrit.wikimedia.org/r/1005845

Change 1006062 had a related patch set uploaded (by Daimona Eaytoy; author: Daimona Eaytoy):

[mediawiki/core@master] tests: Add replacement for assertions deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006062

Change 1006139 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Math@master] tests: Mock LoggerInterface to expect that a warning is thrown

https://gerrit.wikimedia.org/r/1006139

Change 1006137 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/core@master] tests: Run iterator_to_array for Generator before assertCount

https://gerrit.wikimedia.org/r/1006137

Change 1006139 merged by jenkins-bot:

[mediawiki/extensions/Math@master] tests: Mock LoggerInterface to expect that a warning is thrown

https://gerrit.wikimedia.org/r/1006139

Change 1006149 had a related patch set uploaded (by Umherirrender; author: Umherirrender):

[mediawiki/extensions/Wikibase@master] repo: Inject logger into SummaryParsingPrefetchHelper for mocking

https://gerrit.wikimedia.org/r/1006149

Change 1006151 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/Wikibase@master] tests: Replaceme use of expectWarning(), deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006151

Change 1006153 had a related patch set uploaded (by Jforrester; author: Jforrester):

[mediawiki/extensions/WikimediaEvents@master] tests: Replaceme use of expectWarning(), deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006153

Change 1006062 merged by jenkins-bot:

[mediawiki/core@master] tests: Add replacement for assertions deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006062

Change 1006137 merged by jenkins-bot:

[mediawiki/core@master] tests: Run iterator_to_array for Generator before assertCount

https://gerrit.wikimedia.org/r/1006137

Change 1006153 merged by jenkins-bot:

[mediawiki/extensions/WikimediaEvents@master] tests: Replace use of expectWarning(), deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006153

Change 1006151 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] tests: Replace use of expectWarning(), deprecated in PHPUnit 9.6

https://gerrit.wikimedia.org/r/1006151

Change 994327 merged by jenkins-bot:

[mediawiki/core@master] build: Upgrade phpunit to 9.6.16

https://gerrit.wikimedia.org/r/994327

Daimona claimed this task.

Boldly resolving this. PHPUnit has been updated everywhere. Most places already work with the new version, including MW core and gated extensions. Many other non-gated extensions have also been updated; I should have sent patches for all extensions returned by codesearch. Yet, some of those extensions have broken CI, and this seems to have been the case for months. Patches for those extensions have not been merged, but are there in review. That's pretty much all we could do, hence closing this task.

If the update has caused breakage in an extension with otherwise healthy CI, please file a separate task and I'll look into it.

Change 991399 merged by Umherirrender:

[mediawiki/extensions/BlueSpiceBookshelf@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/991399

Change 991385 merged by Umherirrender:

[mediawiki/extensions/LDAPSyncAll@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/991385

Change 977755 merged by Umherirrender:

[mediawiki/extensions/ContentStabilization@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/977755

Change 991421 merged by Umherirrender:

[mediawiki/extensions/Checklists@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/991421

Change 991400 merged by Umherirrender:

[mediawiki/extensions/BlueSpiceFoundation@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/991400

kostajh subscribed.

Boldly resolving this. PHPUnit has been updated everywhere. Most places already work with the new version, including MW core and gated extensions. Many other non-gated extensions have also been updated; I should have sent patches for all extensions returned by codesearch. Yet, some of those extensions have broken CI, and this seems to have been the case for months. Patches for those extensions have not been merged, but are there in review. That's pretty much all we could do, hence closing this task.

If the update has caused breakage in an extension with otherwise healthy CI, please file a separate task and I'll look into it.

Thank you @Daimona and @Jdforrester-WMF!

Change 991423 merged by jenkins-bot:

[mediawiki/extensions/WikispeechSpeechDataCollector@master] Update tests for PHPUnit 9.6

https://gerrit.wikimedia.org/r/991423

Change 1006149 merged by jenkins-bot:

[mediawiki/extensions/Wikibase@master] repo: Inject logger into SummaryParsingPrefetchHelper for mocking

https://gerrit.wikimedia.org/r/1006149

Change 1011395 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/vendor@master] WIP: Update wikimedia/remex-html to 4.1.0

https://gerrit.wikimedia.org/r/1011395

Change 1011396 had a related patch set uploaded (by C. Scott Ananian; author: C. Scott Ananian):

[mediawiki/core@master] Update wikimedia/remex-html to 4.1.0

https://gerrit.wikimedia.org/r/1011396

Change 1011395 merged by jenkins-bot:

[mediawiki/vendor@master] Update wikimedia/remex-html to 4.1.0

https://gerrit.wikimedia.org/r/1011395

Change 1011396 merged by jenkins-bot:

[mediawiki/core@master] Update wikimedia/remex-html to 4.1.0

https://gerrit.wikimedia.org/r/1011396

hashar subscribed.

assertEqualXMLStructure() has been marked deprecated. That emits a warning which our config treat as a failure. That is only used in the Checklists extension for which I have filed as T381013

That's not a sub-task, as it doesn't block this work. This work is done.