X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FTagHooksTest.php;h=06da7a53f709964064d8b58b3e7d191675406fab;hb=1572f3b1b89abc958da6a7d131553e3b67953403;hp=2fdaa1892fccd36987880ede7426ce39de6c09ad;hpb=4af9e538a452c4d9c2d8a3ce84e429068272ae44;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php index 2fdaa1892f..06da7a53f7 100644 --- a/tests/phpunit/includes/parser/TagHooksTest.php +++ b/tests/phpunit/includes/parser/TagHooksTest.php @@ -1,10 +1,13 @@ getContentLanguage() ); return $popt; } @@ -53,8 +56,7 @@ class TagHooksTest extends MediaWikiTestCase { * @dataProvider provideValidNames */ public function testTagHooks( $tag ) { - global $wgParserConf; - $parser = new Parser( $wgParserConf ); + $parser = MediaWikiServices::getInstance()->getParserFactory()->create(); $parser->setHook( $tag, [ $this, 'tagCallback' ] ); $parserOutput = $parser->parse( @@ -72,8 +74,7 @@ class TagHooksTest extends MediaWikiTestCase { * @expectedException MWException */ public function testBadTagHooks( $tag ) { - global $wgParserConf; - $parser = new Parser( $wgParserConf ); + $parser = MediaWikiServices::getInstance()->getParserFactory()->create(); $parser->setHook( $tag, [ $this, 'tagCallback' ] ); $parser->parse( @@ -88,8 +89,7 @@ class TagHooksTest extends MediaWikiTestCase { * @dataProvider provideValidNames */ public function testFunctionTagHooks( $tag ) { - global $wgParserConf; - $parser = new Parser( $wgParserConf ); + $parser = MediaWikiServices::getInstance()->getParserFactory()->create(); $parser->setFunctionTagHook( $tag, [ $this, 'functionTagCallback' ], 0 ); $parserOutput = $parser->parse( @@ -107,8 +107,7 @@ class TagHooksTest extends MediaWikiTestCase { * @expectedException MWException */ public function testBadFunctionTagHooks( $tag ) { - global $wgParserConf; - $parser = new Parser( $wgParserConf ); + $parser = MediaWikiServices::getInstance()->getParserFactory()->create(); $parser->setFunctionTagHook( $tag,