Motivation
Integration Tests are too slow for development: TDD or refactoring, Docker env, prepare DB for each run
It makes development slow.
In fact, some integration tests don't need a database but are not pure unit tests. It's the usual situation for SOLID / GRASP development or refactoring. We needed in ServiceContainer, global configs, legacy support
We can split integration tests into a light and full. Traits or class extensions can be used to DRY.
proof of concept: https://gerrit.wikimedia.org/r/c/mediawiki/core/+/568491/1/tests/phpunit/includes/content/ObjectFactoryMakeContentHandlerWithSpecsToTest.php
We can also prepare MediaWikiService for easy use in unit tests.
Change return of method: MediaWikiService::foceGlobalInstance to void