mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateStyles
synced 2024-11-24 08:14:23 +00:00
Don't use deprecated $wgParserConf global
The modern way to create a Parser object is to use a ParserFactory. Change-Id: I97d58750c91b06eeca5d810509becdf53a39cc95
This commit is contained in:
parent
8f9bb5d11e
commit
eb0babef80
|
@ -1,5 +1,7 @@
|
|||
<?php
|
||||
|
||||
use MediaWiki\MediaWikiServices;
|
||||
|
||||
/**
|
||||
* @group TemplateStyles
|
||||
* @group Database
|
||||
|
@ -154,8 +156,6 @@ class TemplateStylesHooksTest extends MediaWikiLangTestCase {
|
|||
public function testTag(
|
||||
ParserOptions $popt, $getTextOptions, $wikitext, $expect, $globals = []
|
||||
) {
|
||||
global $wgParserConf;
|
||||
|
||||
$this->setMwGlobals( $globals + [
|
||||
'wgScriptPath' => '',
|
||||
'wgScript' => '/index.php',
|
||||
|
@ -179,9 +179,8 @@ class TemplateStylesHooksTest extends MediaWikiLangTestCase {
|
|||
}
|
||||
);
|
||||
|
||||
$class = $wgParserConf['class'];
|
||||
$parser = new $class( $wgParserConf );
|
||||
/** @var Parser $parser */
|
||||
$services = MediaWikiServices::getInstance();
|
||||
$parser = $services->getParserFactory()->create();
|
||||
$parser->firstCallInit();
|
||||
if ( !isset( $parser->mTagHooks['templatestyles'] ) ) {
|
||||
throw new Exception( 'templatestyles tag hook is not in the parser' );
|
||||
|
|
Loading…
Reference in a new issue