For reasons not exactly clear to me, running composer phpunit:unit in MediaWiki core when AbuseFilter is also present in the file system results in:
> phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit PHP Fatal error: Cannot declare class MediaWiki\Extension\AbuseFilter\Tests\Unit\AbuseFilterPermissionManagerTest, because the name is already in use in /Users/kostajh/src/mediawiki/w/extensions/AbuseFilter/tests/phpunit/Unit/AbuseFilterPermissionManagerTest.php on line 18 Fatal error: Cannot declare class MediaWiki\Extension\AbuseFilter\Tests\Unit\AbuseFilterPermissionManagerTest, because the name is already in use in /Users/kostajh/src/mediawiki/w/extensions/AbuseFilter/tests/phpunit/Unit/AbuseFilterPermissionManagerTest.php on line 18 Script phpunit --colors=always --testsuite=core:unit,extensions:unit,skins:unit handling the phpunit:unit event returned with error code 255
On the face of it, it looks like the problem noted in T278707: phpunit.xml.dist: Remove support for both lowercase unit and uppercase Unit directory, as it's unfriendly for case-insensitive OSes, except the directory is already lower case.