-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Hi,
tl;dr: Read the "So what do you need to do?" section
We're currently in the process of upgrading the MediaWiki PHPUnit version to 6. To avoid an immediate breaking change, we will be doing this transition in two steps. First, we will start running tests with both PHPUnit 4 and 6 (next week), using a compatibility layer to support both. Then at some point during the 1.32 or 1.33 release cycles, we'll drop the compatibility layer and just support 6 (and maybe a later version too?).
There are two parts to the compatibility layer. First, an autoloader hack aliases most of the old PHPUnit_Framework_Whatever classes to the new namespaced versions, PHPUnit\Framework\Whatever. This allows tests that use the old class names to continue to work, without any modification. The second part is a trait, PHPUnit4And6Compat, which provides implementations of the getMock() and setExpectedException() functions that were removed in PHPUnit 6. It also has a forward-port of the new createMock() replacement. MediaWikiTestCase uses this trait by default
So what do you need to do? First, run your extension tests locally against PHPUnit 6. Edit MediaWiki core's composer.json's dependency on phpunit/phpunit to say "^6.5", run composer update, and then run your extension's tests. If you run into issues about getMock/setExpectedException, then you probably need to add "use PHPUnit4And6Compat;" to your test class. See [1] for an example. Other problems could relate to some class names changing. If you get stuck, please cc or ping me and I can take a look.
I'd like to start running voting tests against PHPUnit 4 and 6 next week on Thursday (April 12). This should give us just enough time to fix any resulting issues before the 1.31 branch.
[1] https://gerrit.wikimedia.org/r/#/c/424843/
Thanks, - -- Kunal / Legoktm