Problem
The PostCollectionTest class fails if run in a test suite with SpecialPageFatalTest before it. 2 tests fail with errors. Running the classes individually causes no problems.
Steps to reproduce
In a Mediawiki checkout with the Flow extension installed.
- Copy phpunit.dist.xml to phpunit.xml
- Add a test suite with the following two tests:
<testsuite name="failing_group"> <file>tests/phpunit/structure/SpecialPageFatalTest.php</file> <file>extensions/Flow/tests/phpunit/Collection/PostCollectionTest.php</file> </testsuite>
- Run the named test suite:
mw docker mediawiki exec -- composer run phpunit:entrypoint -- --testsuite failing_group
Observed behaviour
The test run fails:
$ mw docker mediawiki exec -- composer run phpunit:entrypoint -- --testsuite failing_group > phpunit '--testsuite' 'failing_group' Using PHP 8.1.18 Running with MediaWiki settings because there might be integration tests PHPUnit 9.6.19 by Sebastian Bergmann and contributors. ..EE..... 9 / 9 (100%) Time: 00:15.221, Memory: 121.00 MB There were 2 errors: 1) Flow\Tests\Collection\PostCollectionTest::testGetCollection Wikimedia\Services\ContainerDisabledException: Container disabled! /var/www/html/w/vendor/wikimedia/services/src/ServiceContainer.php:403 ... === 2) Flow\Tests\Collection\PostCollectionTest::testNewFromId Wikimedia\Services\ContainerDisabledException: Container disabled! /var/www/html/w/vendor/wikimedia/services/src/ServiceContainer.php:403 ... === ERRORS! Tests: 9, Assertions: 187, Errors: 2.
Expected Behaviour
The tests should pass.