Add unit tests to support the functionality added to the OAuth extension for T257982
Description
Details
| Subject | Repo | Branch | Lines +/- | |
|---|---|---|---|---|
| OAuth: Unit tests for new endpoints | mediawiki/extensions/OAuth | master | +773 -10 | |
| OAuth: Unit tests for new endpoints | mediawiki/extensions/OAuth | master | +729 -16 |
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | • eprodromou | T235270 Wikimedia API Gateway | |||
| Resolved | apaskulin | T247837 Create API Portal MVP | |||
| Resolved | • CCicalese_WMF | T259660 Enable new OAuth extension functionality on Beta Meta to support API Portal testing | |||
| Resolved | Art.tsymbar | T257982 Update the OAuth extension to support the API Portal | |||
| Resolved | Art.tsymbar | T259043 Write unit tests for new endpoints in the OAuth extension |
Event Timeline
General rule: our unit tests should test contracts, not implementations. In other words, test what the class/interface/handler is supposed to do, rather than using special knowledge about how it accomplishes it. (Note: testing failures is fine, failing according to contract is super important)
From T257982, the functionality added was:
Each of these is an endpoint in experimentalRoutes.json. I suggest writing a test for each of these endpoints, using the same pattern as the existing AccessTokenEndpointTest and AuthorizationEndpointTest. You can use a @covers tag to indicate that the test covers the related handler class.
Change 618828 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints
Change 624690 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/extensions/OAuth@master] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth into review/art_tsymbar/T259043-unit-tests-for-new-endpoints-in-OAuth-ext Change-Id: Iaa1bdf59a6a7d17f2f277f873456da9f1b7b8dda
Change 624690 abandoned by Art.tsymbar:
[mediawiki/extensions/OAuth@master] Merge branch 'master' of ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/OAuth into review/art_tsymbar/T259043-unit-tests-for-new-endpoints-in-OAuth-ext Change-Id: Iaa1bdf59a6a7d17f2f277f873456da9f1b7b8dda
Reason:
Change 624729 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints
Change 618828 abandoned by Ppchelko:
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints
Reason:
Ic7f8fca6b2be25a0ec0bc8ed68c0b5fae457f442
Change 624729 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints