-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA512
Hi,
On 05/15/2018 11:25 PM, Jeroen De Dauw wrote:
Failing tests: https://travis-ci.org/JeroenDeDauw/Maps/builds/375344161
OK, so you need to use the PHPUnit4And6Compat trait as explained in[1]. That polyfills the setExpectedException() method that was removed in PHPUnit 6. Since you want to support older MediaWiki versions that don't have the trait, if you write your tests expecting PHPUnit 4 and leave a dummy trait in place for older versions, it should work out.
I submitted this as a PR at [2]. Whenever you stop testing against pre-1.31 versions of MediaWiki, you can drop the trait and write your tests expecting PHPUnit 6.
That said, it looks like master of the Maps extension isn't actually running any tests against older versions of MediaWiki, they all seem to report "No tests executed!"[3].
I'd be ideal to have the older versions of MediaWiki use PHPUnit 6.x or later, but I've not found a way to do so yet.
You'd have to backport the PHPUnit4And6Compat trait as well as the autoloader aliasing[4].
[1] https://lists.wikimedia.org/pipermail/wikitech-l/2018-April/089766.html [2] https://github.com/JeroenDeDauw/Maps/pull/424 [3] https://travis-ci.org/JeroenDeDauw/Maps/jobs/378261536 [4] https://gerrit.wikimedia.org/r/plugins/gitiles/mediawiki/core/+/master/t ests/common/TestsAutoLoader.php#191
- -- Legoktm