X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fparser%2FParserTestRunner.php;h=3eb25a9c95d5926e493390d7b9916420717e9ac5;hb=61702397aa04572251869935245c07a0821f6c4a;hp=1c93261a86fdb7f8fd3e076a2009660103db5472;hpb=f5e45bb6d75d6df49fc2285877487ad74d095bf1;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 1c93261a86..3eb25a9c95 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -388,10 +388,10 @@ class ParserTestRunner { 100 => 'MemoryAlpha', 101 => 'MemoryAlpha_talk' ]; - // Changing wgExtraNamespaces invalidates caches in MWNamespace and - // any live Language object, both on setup and teardown + // Changing wgExtraNamespaces invalidates caches in NamespaceInfo and any live Language + // object, both on setup and teardown $reset = function () { - MWNamespace::clearCaches(); + MediaWikiServices::getInstance()->resetServiceForTesting( 'NamespaceInfo' ); MediaWikiServices::getInstance()->getContentLanguage()->resetNamespaces(); }; $setup[] = $reset; @@ -1719,10 +1719,10 @@ class ParserTestRunner { * @return bool True if tag hook is present */ public function requireHook( $name ) { - global $wgParser; + $parser = MediaWikiServices::getInstance()->getParser(); - $wgParser->firstCallInit(); // make sure hooks are loaded. - if ( isset( $wgParser->mTagHooks[$name] ) ) { + $parser->firstCallInit(); // make sure hooks are loaded. + if ( isset( $parser->mTagHooks[$name] ) ) { return true; } else { $this->recorder->warning( " This test suite requires the '$name' hook " . @@ -1738,11 +1738,11 @@ class ParserTestRunner { * @return bool True if function hook is present */ public function requireFunctionHook( $name ) { - global $wgParser; + $parser = MediaWikiServices::getInstance()->getParser(); - $wgParser->firstCallInit(); // make sure hooks are loaded. + $parser->firstCallInit(); // make sure hooks are loaded. - if ( isset( $wgParser->mFunctionHooks[$name] ) ) { + if ( isset( $parser->mFunctionHooks[$name] ) ) { return true; } else { $this->recorder->warning( " This test suite requires the '$name' function " . @@ -1758,11 +1758,11 @@ class ParserTestRunner { * @return bool True if function hook is present */ public function requireTransparentHook( $name ) { - global $wgParser; + $parser = MediaWikiServices::getInstance()->getParser(); - $wgParser->firstCallInit(); // make sure hooks are loaded. + $parser->firstCallInit(); // make sure hooks are loaded. - if ( isset( $wgParser->mTransparentTagHooks[$name] ) ) { + if ( isset( $parser->mTransparentTagHooks[$name] ) ) { return true; } else { $this->recorder->warning( " This test suite requires the '$name' transparent " .