Problem
Running the Flow PHPUnit test suite as a complete suite works normally in, for example, mwdocker and CI environments:
mw docker mediawiki exec MW_DB=wikidatawikidev composer run phpunit:entrypoint -- extensions/Flow/tests/phpunit
but running the RevisionFormatterTest on its own fails with two errors:
$ mw docker mediawiki exec MW_DB=wikidatawikidev composer run phpunit:entrypoint -- extensions/Flow/tests/phpunit/Formatter/RevisionFormatterTest.php > phpunit 'extensions/Flow/tests/phpunit/Formatter/RevisionFormatterTest.php' Using PHP 8.1.18 Running with MediaWiki settings because there might be integration tests PHPUnit 9.6.16 by Sebastian Bergmann and contributors. ......................EE.. 26 / 26 (100%) Time: 00:01.456, Memory: 74.50 MB There were 2 errors: 1) Flow\Tests\Formatter\RevisionFormatterTest::testMockFormatterBasicallyWorks Wikimedia\Services\ContainerDisabledException: Container disabled! ... 2) Flow\Tests\Formatter\RevisionFormatterTest::testFormattingEditedTitle Wikimedia\Services\ContainerDisabledException: Container disabled! ...
This appears to be related to singleton service references and lifecycle management for the MediaWikiServices container.
Acceptance Criteria
- The RevisionFormatterTest class passes when run on its own
- The Flow PHPUnit test suite continues to pass