Page MenuHomePhabricator

Fix "Deprecated: Premature access to service" from data providers when using vendor/bin/phpunit
Closed, ResolvedPublic

Description

vendor/bin/phpunit tests/phpunit/includes/
PHP Deprecated:  Premature access to service container [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2202] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service container [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2202] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'HookContainer' [Called from MediaWiki\MediaWikiServices::getInstance in /Users/kostajh/src/mediawiki/w/includes/MediaWikiServices.php at line 279] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'HookContainer' [Called from MediaWiki\MediaWikiServices::getInstance in /Users/kostajh/src/mediawiki/w/includes/MediaWikiServices.php at line 279] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ObjectFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 677] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ObjectFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 677] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'DBLoadBalancer' [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2203] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'DBLoadBalancer' [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2203] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'DBLoadBalancerFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 498] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'DBLoadBalancerFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 498] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'MainConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 503] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'MainConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 503] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ConfigFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 885] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ConfigFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 885] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'BootstrapConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 382] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'BootstrapConfig' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 382] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'StatsdDataFactory' [Called from ObjectCache::newFromParams in /Users/kostajh/src/mediawiki/w/includes/objectcache/ObjectCache.php at line 149] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'StatsdDataFactory' [Called from ObjectCache::newFromParams in /Users/kostajh/src/mediawiki/w/includes/objectcache/ObjectCache.php at line 149] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'MainWANObjectCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 521] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'MainWANObjectCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 521] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LocalServerObjectCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 526] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LocalServerObjectCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 526] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ConfiguredReadOnlyMode' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 535] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ConfiguredReadOnlyMode' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 535] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'CriticalSectionProvider' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 539] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'CriticalSectionProvider' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 539] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'TitleParser' [Called from Title::secureAndSplit in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 3038] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'TitleParser' [Called from Title::secureAndSplit in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 3038] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service '_MediaWikiTitleCodec' [Called from Wikimedia\Services\ServiceContainer::createService in /Users/kostajh/src/mediawiki/w/vendor/wikimedia/services/src/ServiceContainer.php at line 447] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service '_MediaWikiTitleCodec' [Called from Wikimedia\Services\ServiceContainer::createService in /Users/kostajh/src/mediawiki/w/vendor/wikimedia/services/src/ServiceContainer.php at line 447] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ContentLanguage' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2003] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ContentLanguage' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2003] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LanguageFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 415] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LanguageFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 415] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LocalisationCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 765] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LocalisationCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 765] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LanguageNameUtils' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 859] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LanguageNameUtils' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 859] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LanguageFallback' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 767] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LanguageFallback' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 767] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LanguageConverterFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 768] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LanguageConverterFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 768] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'GenderCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2004] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'GenderCache' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2004] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'NamespaceInfo' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 627] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'NamespaceInfo' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 627] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service '_DefaultOptionsLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 632] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service '_DefaultOptionsLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 632] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'InterwikiLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2006] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'InterwikiLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 2006] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'BlockUtils' [Called from MediaWiki\Block\AbstractBlock::setTarget in /Users/kostajh/src/mediawiki/w/includes/block/AbstractBlock.php at line 395] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'BlockUtils' [Called from MediaWiki\Block\AbstractBlock::setTarget in /Users/kostajh/src/mediawiki/w/includes/block/AbstractBlock.php at line 395] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'UserIdentityLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 316] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'UserIdentityLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 316] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ActorStoreFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1812] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ActorStoreFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1812] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'UserNameUtils' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 201] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'UserNameUtils' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 201] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LinkCache' [Called from Title::resetArticleID in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 2983] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LinkCache' [Called from Title::resetArticleID in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 2983] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'TitleFormatter' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 807] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'TitleFormatter' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 807] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'RestrictionStore' [Called from Title::resetArticleID in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 2984] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'RestrictionStore' [Called from Title::resetArticleID in /Users/kostajh/src/mediawiki/w/includes/Title.php at line 2984] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'CommentStore' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1430] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'CommentStore' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1430] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'PageStore' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1432] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'PageStore' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1432] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'PageStoreFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1126] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'PageStoreFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1126] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ContentHandlerFactory' [Called from AbstractContent::getContentHandlerFactory in /Users/kostajh/src/mediawiki/w/includes/content/AbstractContent.php at line 107] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ContentHandlerFactory' [Called from AbstractContent::getContentHandlerFactory in /Users/kostajh/src/mediawiki/w/includes/content/AbstractContent.php at line 107] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'UserFactory' [Called from User::newFromName in /Users/kostajh/src/mediawiki/w/includes/user/User.php at line 616] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'UserFactory' [Called from User::newFromName in /Users/kostajh/src/mediawiki/w/includes/user/User.php at line 616] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'MessageCache' [Called from Message::fetchMessage in /Users/kostajh/src/mediawiki/w/includes/language/Message.php at line 1452] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'MessageCache' [Called from Message::fetchMessage in /Users/kostajh/src/mediawiki/w/includes/language/Message.php at line 1452] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'Parser' [Called from MessageCache::getParser in /Users/kostajh/src/mediawiki/w/includes/cache/MessageCache.php at line 1261] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'Parser' [Called from MessageCache::getParser in /Users/kostajh/src/mediawiki/w/includes/cache/MessageCache.php at line 1261] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'ParserFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1188] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'ParserFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1188] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'MagicWordFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1223] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'MagicWordFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1223] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'SpecialPageFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1226] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'SpecialPageFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1226] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'TitleFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1690] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'TitleFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1690] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LinkRendererFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1227] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LinkRendererFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1227] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'BadFileLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1230] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'BadFileLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1230] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'RepoGroup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 245] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'RepoGroup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 245] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'MimeAnalyzer' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1358] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'MimeAnalyzer' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1358] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'Tidy' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1233] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'Tidy' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1233] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'UserOptionsLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1235] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'UserOptionsLookup' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1235] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'UserOptionsManager' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1840] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'UserOptionsManager' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1840] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'HttpRequestFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1238] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'HttpRequestFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1238] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'TrackingCategories' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1239] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'TrackingCategories' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 1239] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'SkinFactory' [Called from Skin::normalizeKey in /Users/kostajh/src/mediawiki/w/includes/skins/Skin.php at line 208] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'SkinFactory' [Called from Skin::normalizeKey in /Users/kostajh/src/mediawiki/w/includes/skins/Skin.php at line 208] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'FileBackendGroup' [Called from FileBackendIntegrationTest::provider_testGetContentType in /Users/kostajh/src/mediawiki/w/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php at line 2499] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'FileBackendGroup' [Called from FileBackendIntegrationTest::provider_testGetContentType in /Users/kostajh/src/mediawiki/w/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php at line 2499] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'LockManagerGroupFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 620] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'LockManagerGroupFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 620] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Deprecated:  Premature access to service 'TempFSFileFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 621] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service 'TempFSFileFactory' [Called from Wikimedia\Services\ServiceContainer::{closure} in /Users/kostajh/src/mediawiki/w/includes/ServiceWiring.php at line 621] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 111

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 111
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 115

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 115
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 117

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 117
^C
(base) ➜  w git:(T297287) ✗ vendor/bin/phpunit tests/phpunit/includes/
PHP Deprecated:  Premature access to service container [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2202] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377

Deprecated: Premature access to service container [Called from wfGetDB in /Users/kostajh/src/mediawiki/w/includes/GlobalFunctions.php at line 2202] in /Users/kostajh/src/mediawiki/w/includes/debug/MWDebug.php on line 377
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 111

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 111
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 115

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 115
PHP Notice:  Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line 117

Notice: Trying to access array offset on value of type bool in /Users/kostajh/src/mediawiki/w/includes/filebackend/FileBackendGroup.php on line

Event Timeline

When vendor/bin/phpunit is invoked, we don't have a way to know in its bootstrap file if it is executing unit or integration tests, and we don't want to pollute global scope for unit tests. So we can't e.g. add MediaWikiServices::getInstance()->allowGlobalInstance() in TestSetup.php. One option is to silence this deprecation warning added in rMW47bb958f039c: Deprecate premature instantiation of services. when MW_PHPUNIT_TEST is defined.

Change 745253 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] phpunit: Silence premature access to service deprecation warnings

https://gerrit.wikimedia.org/r/745253

When vendor/bin/phpunit is invoked, we don't have a way to know in its bootstrap file if it is executing unit or integration tests, and we don't want to pollute global scope for unit tests. So we can't e.g. add MediaWikiServices::getInstance()->allowGlobalInstance() in TestSetup.php. One option is to silence this deprecation warning added in rMW47bb958f039c: Deprecate premature instantiation of services. when MW_PHPUNIT_TEST is defined.

Actually, it looks these may all be from dataProviders accessing the MediaWikiServices global instance, so instead we should fix the dataProviders to not do that.

Change 745253 abandoned by Kosta Harlan:

[mediawiki/core@master] phpunit: Silence premature access to service deprecation warnings

Reason:

/T297292#7556352

https://gerrit.wikimedia.org/r/745253

Change 745256 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] RestrictionStoreTest: Don't access services in data providers

https://gerrit.wikimedia.org/r/745256

Change 745259 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] CreationHandlerTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745259

kostajh renamed this task from Deprecated: Premature access to service when vendor/bin/phpunit is used to Deprecated: Premature access to service when vendor/bin/phpunit is used and dataProvider access MW services.Dec 8 2021, 2:26 PM

Change 745261 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] UpdateHandlerTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745261

Change 745262 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/core@master] SpecialPageAliasTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745262

Change 745266 had a related patch set uploaded (by Kosta Harlan; author: Kosta Harlan):

[mediawiki/extensions/EventBus@master] phpunit: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745266

Change 745259 merged by jenkins-bot:

[mediawiki/core@master] CreationHandlerTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745259

Change 745256 merged by jenkins-bot:

[mediawiki/core@master] RestrictionStoreTest: Don't access services in data providers

https://gerrit.wikimedia.org/r/745256

Change 745261 merged by jenkins-bot:

[mediawiki/core@master] UpdateHandlerTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745261

Change 745262 merged by jenkins-bot:

[mediawiki/core@master] SpecialPageAliasTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745262

Change 745266 merged by jenkins-bot:

[mediawiki/extensions/EventBus@master] phpunit: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/745266

Once these are all fixed, it would be nice to have a test to prevent code in data providers from accessing service providers. That could be something in quibble that uses --list-tests to check for Deprecated: Premature access to service messages, I guess? Ideally it would be a structure test included in MediaWiki core but I don't think that will work.

Krinkle renamed this task from Deprecated: Premature access to service when vendor/bin/phpunit is used and dataProvider access MW services to Fix "Deprecated: Premature access to service" from data providers when using vendor/bin/phpunit.Jan 19 2022, 5:44 PM
Krinkle updated the task description. (Show Details)

Change 763463 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] ApiQueryBlockInfoTraitTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/763463

Change 763465 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] ApiQuerySiteinfoTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/763465

Change 763466 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] ApiBaseTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/763466

Change 763467 had a related patch set uploaded (by Aaron Schulz; author: Aaron Schulz):

[mediawiki/core@master] ApiBlockInfoTraitTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/763467

Change 763465 merged by jenkins-bot:

[mediawiki/core@master] ApiQuerySiteinfoTest: Don't access MW services in dataProvider

https://gerrit.wikimedia.org/r/763465

Well, I think we can revert any of these that are not specifically for unit (as opposed to integration) tests.

The solution we settled on in T90875: Use vendor/bin/phpunit instead of tests/phpunit/phpunit.php (thank you @Tgr) was to have two separate bootstrap files. In phpunit.xml.dist we default to a bootstrap.integration.php file which will allow using MW services in dataProviders, while the more strict bootstrap.php (for use with unit tests, which live in tests/phpunit/unit) will not allow that.

Change 763467 abandoned by Krinkle:

[mediawiki/core@master] ApiBlockInfoTraitTest: Don't access MW services in dataProvider

Reason:

No longer needed

https://gerrit.wikimedia.org/r/763467

Change 763466 abandoned by Krinkle:

[mediawiki/core@master] ApiBaseTest: Don't access MW services in dataProvider

Reason:

No longer needed

https://gerrit.wikimedia.org/r/763466

Krinkle closed this task as Resolved.EditedJun 8 2022, 7:12 PM
Krinkle assigned this task to kostajh.

Per @kostajh's last comment above: For IntegrationTestCase tests, MWServices is allowed in our phpunit boostrap file for phpunit. It is only the "pure" unit tests where MWServices is disallowed (naturally), and there it is disabled both in providers and during tests. There is afaik not a case where it's fine in tests but not in providers.

Change 763463 abandoned by Krinkle:

[mediawiki/core@master] ApiQueryBlockInfoTraitTest: Don't access MW services in dataProvider

Reason:

https://gerrit.wikimedia.org/r/763463