Page MenuHomePhabricator

Make PHPUnit dataProvider static in OAuth tests
Closed, ResolvedPublic

Description

The @dataProvider annotation should be a static function, check and make data provider in the extension, at least:

  • ConsumerSubmitControlTest with provideSubmit_propose_OAuth1 and provideSubmit_propose_OAuth2
  • abstract EndpointTest with provideTestHandlerExecute

static and adjust the usages (More infos at T332865).

Initial work was done in 4bb301bf2edccd12277fb1f2667d9591b25d605a

Event Timeline

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

[mediawiki/extensions/OAuth@master] tests: Move base data from data provider to test runtime

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

Krinkle added subscribers: Tgr, Krinkle.

Assigning to @Tgr per comment at https://gerrit.wikimedia.org/r/c/mediawiki/extensions/OAuth/ /910803.

If you decide that removing these assertions is fine, I'm happy to pick up where I left off. Alternatively, if you prefer to fix the tests in the current state, I'd also happy to resume this task after the assertions pass. Either way is fine :)

Change #1015652 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/OAuth@master] Fix ConsumerSubmitControlTest

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

Change #1015653 had a related patch set uploaded (by Gergő Tisza; author: Gergő Tisza):

[mediawiki/extensions/OAuth@master] Make EndpointTestBase-based data providers static

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

Change #1015652 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Fix ConsumerSubmitControlTest

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

Change #1015618 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] tests: Port ConsumerSubmitControlTest assertion closures to test cases

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

Krinkle triaged this task as Medium priority.

Change #1015653 merged by jenkins-bot:

[mediawiki/extensions/OAuth@master] Make EndpointTestBase-based data providers static

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