Page MenuHomePhabricator

Phase out PHPUnit expected exception annotations from tests
Closed, ResolvedPublic

Description

The following annotations were removed in PHPUnit 7:

  • @expectedException
  • @expectedExceptionCode
  • @expectedExceptionMessage
  • @expectedExceptionMessageRegExp

Instead, TestCase methods like expectException() should be used. In order to upgrade to PHPUnit 8, we need to get rid of those.

Code search results:

Details

SubjectRepoBranchLines +/-
mediawiki/extensions/DonationInterfacemaster+51 -53
mediawiki/extensions/MediaWikiFarmmaster+131 -204
mediawiki/extensions/LDAPAuthorizationmaster+11 -9
mediawiki/extensions/WikibaseLexememaster+172 -279
mediawiki/extensions/BlueSpiceFoundationmaster+84 -65
mediawiki/extensions/Wikibasemaster+75 -144
mediawiki/extensions/SimpleSAMLphpmaster+19 -15
mediawiki/extensions/JsonDatamaster+9 -17
mediawiki/skins/BlueSpiceCalummamaster+11 -10
mediawiki/extensions/WikibaseMediaInfomaster+6 -16
mediawiki/extensions/Wikispeechmaster+17 -31
mediawiki/skins/MinervaNeuemaster+11 -11
mediawiki/extensions/QuickSurveysmaster+17 -34
mediawiki/extensions/EntitySchemamaster+7 -19
mediawiki/extensions/LDAPProvidermaster+35 -34
mediawiki/extensions/PageTriagemaster+10 -17
mediawiki/extensions/MobileFrontendmaster+4 -5
mediawiki/extensions/Mathmaster+14 -30
mediawiki/extensions/MathSearchmaster+7 -15
mediawiki/extensions/TemplateStylesmaster+4 -8
mediawiki/extensions/LoginNotifymaster+1 -3
mediawiki/coremaster+50 -62
mediawiki/coremaster+54 -67
mediawiki/tools/codesniffermaster+32 -17
Show related patches Customize query in gerrit

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes
MaxSem renamed this task from Phase out to Phase out PHPUnit expected exception annotations from tests.Oct 4 2019, 6:22 AM

Codesniffer can help you on avoiding new annotations.

The annotations are currently whitelist in PhpunitAnnotationsSniff and could be moved from $allowedAnnotations to $forbiddenAnnotations with own message to avoid that new annoations are added

Daimona subscribed.

Codesniffer can help you on avoiding new annotations.

The annotations are currently whitelist in PhpunitAnnotationsSniff and could be moved from $allowedAnnotations to $forbiddenAnnotations with own message to avoid that new annoations are added

Yeah, let's include that in the next PHPCS release.

Change 540848 had a related patch set uploaded (by Daimona Eaytoy; owner: Daimona Eaytoy):
[mediawiki/tools/codesniffer@master] Forbid PHPUnit @expectedException* annotations

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

Change 540848 merged by jenkins-bot:
[mediawiki/tools/codesniffer@master] Forbid PHPUnit @expectedException* annotations

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

Change 540988 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] Cleanup of old PHPUnit usage, part 2

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

Change 540989 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/core@master] Cleanup of old PHPUnit usage, part 2

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

Change 540988 merged by jenkins-bot:
[mediawiki/core@master] Cleanup of old PHPUnit usage, part 2

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

Change 540989 merged by jenkins-bot:
[mediawiki/core@master] Cleanup of old PHPUnit usage, part 3

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

Change 541366 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/LoginNotify@master] Use expectException() instead of annotations

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

Change 541366 merged by jenkins-bot:
[mediawiki/extensions/LoginNotify@master] Use expectException() instead of annotations

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

Change 542648 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/TemplateStyles@master] @expectedException is deprecated

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

Change 542648 merged by jenkins-bot:
[mediawiki/extensions/TemplateStyles@master] @expectedException is deprecated

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

Change 543262 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/Math@master] tests: @expectedException is deprecated

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

Change 543264 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/MathSearch@master] tests: @expectedException is deprecated

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

Change 543265 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/MobileFrontend@master] tests: @expectedException is deprecated

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

Change 543264 merged by jenkins-bot:
[mediawiki/extensions/MathSearch@master] tests: @expectedException is deprecated

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

Change 543262 merged by jenkins-bot:
[mediawiki/extensions/Math@master] tests: @expectedException is deprecated

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

Change 543265 merged by jenkins-bot:
[mediawiki/extensions/MobileFrontend@master] tests: @expectedException is deprecated

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

Change 544276 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/LDAPAuthorization@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544277 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/PageTriage@master] tests: @expectedException is deprecated

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

Change 544280 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/JsonData@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544281 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/LDAPProvider@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544277 merged by jenkins-bot:
[mediawiki/extensions/PageTriage@master] tests: @expectedException is deprecated

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

Change 544281 merged by jenkins-bot:
[mediawiki/extensions/LDAPProvider@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544339 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/EntitySchema@master] tests: @expectedException is deprecated

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

Change 544340 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/skins/MinervaNeue@master] tests: @expectedException is deprecated

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

Change 544341 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/QuickSurveys@master] tests: @expectedException is deprecated

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

Change 544346 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/WikibaseMediaInfo@master] tests: @expectedException is deprecated

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

Change 544347 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/Wikispeech@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544348 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/skins/BlueSpiceCalumma@master] build: Bump mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544350 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/Wikibase@master] tests: @expectedException is deprecated

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

Change 544339 merged by jenkins-bot:
[mediawiki/extensions/EntitySchema@master] tests: @expectedException is deprecated

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

Change 544340 merged by jenkins-bot:
[mediawiki/skins/MinervaNeue@master] tests: @expectedException is deprecated

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

Change 544341 merged by jenkins-bot:
[mediawiki/extensions/QuickSurveys@master] tests: @expectedException is deprecated

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

Change 544346 merged by jenkins-bot:
[mediawiki/extensions/WikibaseMediaInfo@master] tests: @expectedException is deprecated

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

Change 544347 merged by jenkins-bot:
[mediawiki/extensions/Wikispeech@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544348 merged by jenkins-bot:
[mediawiki/skins/BlueSpiceCalumma@master] build: Bump mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544280 merged by jenkins-bot:
[mediawiki/extensions/JsonData@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544407 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/BlueSpiceFoundation@master] build: Update mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544409 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/SimpleSAMLphp@master] build: Bump mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544409 merged by jenkins-bot:
[mediawiki/extensions/SimpleSAMLphp@master] build: Bump mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544350 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] tests: @expectedException is deprecated

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

Change 544419 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/WikibaseLexeme@master] tests: @expectedException is deprecated

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

Change 544423 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/MediaWikiFarm@master] build: Update to mediawiki-codesniffer 28.0.0 and make it pass

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

Change 544436 had a related patch set uploaded (by MaxSem; owner: MaxSem):
[mediawiki/extensions/DonationInterface@master] build: Bump mediawiki-codesniffer to 28.0.0 and mke it pass

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

Change 544407 merged by jenkins-bot:
[mediawiki/extensions/BlueSpiceFoundation@master] build: Update mediawiki-codesniffer to 28.0.0 and make it pass

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

Change 544419 merged by jenkins-bot:
[mediawiki/extensions/WikibaseLexeme@master] tests: @expectedException is deprecated

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

Change 544276 merged by Daimona Eaytoy:
[mediawiki/extensions/LDAPAuthorization@master] build: Bump mediawiki-codesniffer to 28.0.0 and make a pass

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

Change 544423 abandoned by MaxSem:
build: Update to mediawiki-codesniffer 28.0.0 and make it pass

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

Jdforrester-WMF assigned this task to Daimona.

This is done for Wikimedia-hosted extensions (except DonationInterface which needs to maintain MW 1.31 compatibility for another six months), and all extensions except MediaWikiFarm (where it's left to the maintainer). Declaring this Resolved.

Change 544436 abandoned by Ejegg:

[mediawiki/extensions/DonationInterface@master] build: Bump mediawiki-codesniffer to 28.0.0 and make it pass

Reason:

Thanks for this work! Repo has since been updated to v38

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

  NODES
Note 7
Project 14