Page MenuHomePhabricator

Phase out PHPUnit expected exception annotations from tests
Open, Needs TriagePublic

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

Related Gerrit Patches:
mediawiki/extensions/MediaWikiFarm : masterbuild: Update to mediawiki-codesniffer 28.0.0 and make it pass
mediawiki/extensions/DonationInterface : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make it pass
mediawiki/extensions/LDAPAuthorization : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make a pass
mediawiki/extensions/WikibaseLexeme : mastertests: @expectedException is deprecated
mediawiki/extensions/BlueSpiceFoundation : masterbuild: Update mediawiki-codesniffer to 28.0.0 and make it pass
mediawiki/extensions/Wikibase : mastertests: @expectedException is deprecated
mediawiki/extensions/SimpleSAMLphp : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make it pass
mediawiki/extensions/JsonData : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make a pass
mediawiki/skins/BlueSpiceCalumma : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make it pass
mediawiki/extensions/WikibaseMediaInfo : mastertests: @expectedException is deprecated
mediawiki/extensions/Wikispeech : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make a pass
mediawiki/skins/MinervaNeue : mastertests: @expectedException is deprecated
mediawiki/extensions/QuickSurveys : mastertests: @expectedException is deprecated
mediawiki/extensions/EntitySchema : mastertests: @expectedException is deprecated
mediawiki/extensions/LDAPProvider : masterbuild: Bump mediawiki-codesniffer to 28.0.0 and make a pass
mediawiki/extensions/PageTriage : mastertests: @expectedException is deprecated
mediawiki/extensions/MobileFrontend : mastertests: @expectedException is deprecated
mediawiki/extensions/Math : mastertests: @expectedException is deprecated
mediawiki/extensions/MathSearch : mastertests: @expectedException is deprecated
mediawiki/extensions/TemplateStyles : master@expectedException is deprecated
mediawiki/extensions/LoginNotify : masterUse expectException() instead of annotations
mediawiki/core : masterCleanup of old PHPUnit usage, part 3
mediawiki/core : masterCleanup of old PHPUnit usage, part 2
mediawiki/tools/codesniffer : masterForbid PHPUnit @expectedException* annotations

Event Timeline

MaxSem created this task.Oct 4 2019, 6:21 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 4 2019, 6:21 AM
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 claimed this task.Oct 4 2019, 12:12 PM
Daimona added a subscriber: Daimona.

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

Krinkle moved this task from Inbox to PHPUnit on the MediaWiki-Core-Testing board.Oct 15 2019, 6:46 PM

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

Daimona removed Daimona as the assignee of this task.Oct 18 2019, 4:43 PM

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