Page MenuHomePhabricator

Write unit tests for new endpoints in the OAuth extension
Closed, ResolvedPublic

Description

Add unit tests to support the functionality added to the OAuth extension for T257982

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:

  • List their clients and view client details
  • Create a client (T251280)
  • Reset client secret (T254200)

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

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

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: Iaa1bdf

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

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: Iaa1bdf

Reason:

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

Change 624729 had a related patch set uploaded (by Art.tsymbar; owner: arttsymbar):
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints

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

Change 618828 abandoned by Ppchelko:
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints

Reason:
Ic7f8fc

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

Change 624729 merged by jenkins-bot:
[mediawiki/extensions/OAuth@master] OAuth: Unit tests for new endpoints

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