-----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
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiEE+h6fmkHn9DUCyl1jUvyOe+23/KIFAlrJlKcACgkQUvyOe+23
/KKmbQ//UalxjQ9xzsn7sceXUM6y8YFgQtJH08RRq+34tZMXJSEPdoif3xlJm53L
5HfVuFcF73wAtLElM1JKjB30fYOD+7yZ+joLzrgBJ+81bHDncCK+ldOUPrSSHvcZ
PuWMcjJ9QimFSRon/ar09GRIEaL1WbXDM+J4EOlViThuTAevoqO+lgeSimkPBkPD
K1mxtpES5DGLRiQhAX1OZtuOJBuKfX0bshX7RO833Z2ZnwCLjcTTyyUQClANP9yR
xsVQCqtUTvtbMnx3zH3FhWxbI6qQosEqdK+nS2kwXMKw72roKXe3r6yDJtqHNaTy
gz/lj3HJYynNjVcF9sVDmBL5pqrpG5NLDiz4AZJrViaRLsfqX+ibcKPQpoaWh9fh
gz6Y7DzFpB3gDXepJmy+SJCidksB6YMOs+BQMQjqKBSrVHvFuKIt3zHxZ13aUQ+L
lCyp7pfB83Q1NpKm8ss2lUVGDiEL+1yU45c3MixBjdx/I4fCdF5RfdEpHA/N1scG
G4uMiPf9TprV3vHk57sS7AAZembqOGj5lTCceKAgFVil0TlHzsYjgBcaQbU0qecI
bb9/uxPeEP7pJ4mEbgJGzCa9aQaVI6qQ+LORC84BD24l3k8M/6pFfkZ52BOz2lAy
VE/2rXRcmFPbTkWgh8J3yEIjwgCeDOKK/JDVyhdIeWwz65MOOMs=
=BmSB
-----END PGP SIGNATURE-----