Seen while debugging test failures for https://gerrit.wikimedia.org/r/c/mediawiki/core/+/813209.
Modify extensions/Wikibase/repo/tests/phpunit/includes/Hooks/HtmlPageLinkRendererEndHookHandlerTest.php to query user names for your wiki. You'd expect to just see UTSysop, but instead the full list of user names on your local wiki is output: php tests/phpunit/phpunit.php extensions/Wikibase/repo/tests/phpunit/includes/Hooks/HtmlPageLinkRendererEndHookHandlerTest.php --filter=testExtractForeignIdString
<?php /** * @dataProvider linkTargetProvider */ public function testExtractForeignIdString( $linkTarget, $expectedOutput ) { $wrapper = TestingAccessWrapper::newFromObject( $this->newInstance() ); $output = $wrapper->extractForeignIdString( $linkTarget ); $this->assertSame( $expectedOutput, $output ); } public function linkTargetProvider() { $db = wfGetDB( DB_PRIMARY ); $selectQuery = new SelectQueryBuilder( $db ); $result = $selectQuery ->table( 'user' ) ->field( 'user_name' ) ->fetchFieldValues(); var_dump( $result ); return [ 'NS=MAIN, title=null' => [ Title::makeTitle( NS_MAIN, null ), null ], // T260853 'NS=SPECIAL, title=null' => [ Title::makeTitle( NS_SPECIAL, null ), null ], 'NS=SPECIAL, title=EntityPage/Q123' => [ Title::newFromTextThrow( 'Special:EntityPage/Q123' ), 'Q123' ], // One of the defaults from MediaWiki's maintenance/interwiki.list (but not Wikidata, as this might be the local test wiki name) 'NS=MAIN, title=Special:EntityPage/Q123' => [ Title::newFromTextThrow( 'metawikimedia:Special:EntityPage/Q123' ), 'Q123' ], ]; }
Note that with https://gerrit.wikimedia.org/r/c/mediawiki/core/+/813209, access to the main DB is prevented, and the interwiki table is empty, which is why the test fails.