Refactor MediaWikiIntegrationTestCase::resetDB() for readability
authorThiemo Kreuz <thiemo.kreuz@wikimedia.de>
Fri, 13 Sep 2019 09:47:00 +0000 (11:47 +0200)
committerThiemo Kreuz (WMDE) <thiemo.kreuz@wikimedia.de>
Thu, 19 Sep 2019 15:39:55 +0000 (15:39 +0000)
commit37090961265b05a5418960a13a902e9ac751a259
tree323664bc06a8624fff9a6494109eaedc4424f574
parent0e2241ad6c9fd1ac055ce1a829144a021dfdb79f
Refactor MediaWikiIntegrationTestCase::resetDB() for readability

This was inspired by I1b2a6eb. As far as I can tell this patch does not
change anything in terms of behavior. My main motivation was to get rid
of the (possibly confusing) duplications, and turn them into a loop.

The special case where TestUserRegistry::clear() is executed appears like
it might not do the exact same as before, but I'm pretty sure it does.
Before, the special case was executed whenever any of the user tables was
present in the $tablesUsed array originally passed to the method. The
same still happens.

Additional changes:
* Strict type hints in the method signature.

Change-Id: I7f292095c0dac99b9cc0b0aa5ce10703f24f8bba
tests/phpunit/MediaWikiIntegrationTestCase.php