Thanks, Amir! That's a great idea. My regexps were a bit naive and there's still some space for improvement, so I'll comment about that on the gist.
As for removing the PHPUnit4And6Compat trait: I think we should do that regardless of this migration. In fact, I'd like to draw some attention to T234721. Basically, any test using the trait directly does so because it extends PHPUnit\Framework\TestCase. And in turn, this happens because MediaWikiUnitTestCase validates the directory structure, but some repos do not comply. Hence, we should implement a way to use MediaWikiUnitTestCase even with non-standard directories (3 proposals on phab). Then we could migrate everything with another script. This will also make it easier to transition to PHPUnit 8, if we want to add another backward/forward-compat layer. Il giorno sab 5 ott 2019 alle ore 23:58 Amir Sarabadani <ladsgr...@gmail.com> ha scritto: > Thanks Daimona! > In the spirit of automating everything including ourselves, I wrote a quick > python script using Daimon's regexes to run on codebases and it tries to > clean as much as possible for you. > https://gist.github.com/Ladsgroup/bfb4f4b66384efb8b8d3efea338b6e6b > (After running this, you should run composer fix to fix phpcs issues) > > Feel free to change the gist and put it in comment, so I fix it. > > On Fri, Oct 4, 2019 at 1:58 PM Daimona <daimona.w...@gmail.com> wrote: > > > Hello all, > > Following our migration away from HHVM, we're now also requiring PHPUnit > 6+ > > . Previously, we were allowing PHPUnit 4 as an option, but that > version > > was EOLed in February 2017 . > > > > MediaWiki core provides a backward/forward-compatible layer  to allow > > working with both versions. However, that trait will be emptied and > removed > > soon, partly because we want to move to PHPUnit 8. > > > > Hence, if you have a local install of PHPUnit 4, you won't be able to use > > it anymore. I also invite you to check whether any of your repos has an > > explicit PHPUnit dependency in composer.json . If it does, you can now > > remove PHPUnit 4 from it. > > > > Thank you for your collaboration! > > > >  - https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/426058/ > >  - https://phpunit.de/supported-versions.html > >  - > > > > > https://gerrit.wikimedia.org/g/mediawiki/core/+/e26299b1d14feb341ff5752696f8a24045df9838/tests/phpunit/PHPUnit4And6Compat.php > >  - List of repos that do have it: > > > > > https://codesearch.wmflabs.org/search/?q=%22phpunit%5C%2Fphpunit%22%3A&i=nope&files=%5Ecomposer%5C.json%24&repos= > > > > -- > > https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy > > "Daimona" is not my real name -- he/him > > _______________________________________________ > > Wikitech-l mailing list > > Wikitechfirstname.lastname@example.org > > https://lists.wikimedia.org/mailman/listinfo/wikitech-l > > > > -- > Amir (he/him) > _______________________________________________ > Wikitech-l mailing list > Wikitechemail@example.com > https://lists.wikimedia.org/mailman/listinfo/wikitech-l -- https://meta.wikimedia.org/wiki/User:Daimona_Eaytoy "Daimona" is not my real name -- he/him _______________________________________________ Wikitech-l mailing list Wikitechfirstname.lastname@example.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l