Problem
The ConfigHelperTest and MinervaPagePermissionsTest classes generate failures if run in a test suite with SpecialListDatatypesTest before it. 3 tests fail. Running the classes individually causes no problems.
Steps to reproduce
In a Mediawiki checkout with Wikibase, Vector and Minerva installed.
- Copy phpunit.dist.xml to phpunit.xml
- Add a test suite with the following two tests:
<testsuite name="failing_group"> <file>extensions/Wikibase/repo/tests/phpunit/includes/Specials/SpecialListDatatypesTest.php</file> <file>skins/Vector/tests/phpunit/integration/ConfigHelperTest.php</file> <file>skins/MinervaNeue/tests/phpunit/permissions/MinervaPagePermissionsTest.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 -- MW_DB=wikidatawikidev composer run --timeout=0 phpunit:entrypoint -- --testsuite new_bad --exclude-group Database,Broken,ParserFuzz,Stub,Standalone
> phpunit '--testsuite' 'new_bad' '--exclude-group' 'Database,Broken,ParserFuzz,Stub,Standalone'
Using PHP 8.1.18
Running with MediaWiki settings because there might be integration tests
PHPUnit 9.6.19 by Sebastian Bergmann and contributors.
...F.F.......F................. 31 / 31 (100%)
Time: 00:01.252, Memory: 58.50 MB
There were 3 failures:
1) MediaWiki\Skins\Vector\Tests\Integration\ConfigHelperTest::testShouldDisableMainPage with data set #0 (true)
Failed asserting that true is identical to false.
/var/www/html/w/skins/Vector/tests/phpunit/integration/ConfigHelperTest.php:37
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
===
2) MediaWiki\Skins\Vector\Tests\Integration\ConfigHelperTest::testShouldDisableMainPageImplicit
Failed asserting that true is false.
/var/www/html/w/skins/Vector/tests/phpunit/integration/ConfigHelperTest.php:48
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
===
3) MediaWiki\Minerva\MinervaPagePermissionsTest::testWatchAndEditNotAllowedOnMainPage
Failed asserting that true is false.
/var/www/html/w/skins/MinervaNeue/tests/phpunit/permissions/MinervaPagePermissionsTest.php:89
=== Logs generated by test case
[objectcache] [debug] MainWANObjectCache using store {class} {"class":"HashBagOStuff"}
[localisation] [debug] LocalisationCache using store LCStoreNull []
[MessageCache] [debug] MessageCache using store {class} {"class":"HashBagOStuff"}
[wfDebug] [debug] ParserFactory: using default preprocessor {"private":false}
[localisation] [debug] LocalisationCache::isExpired(en): cache missing, need to make one []
[objectcache] [debug] MainObjectStash using store {class} {"class":"HashBagOStuff"}
===
FAILURES!
Tests: 31, Assertions: 67, Failures: 3.Expected Behaviour
The tests should pass.