X-Git-Url: https://git.cyclocoop.org/%242?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FTagHooksTest.php;h=06da7a53f709964064d8b58b3e7d191675406fab;hb=414215ccac0f3288ccb1a40a5a8e29b9a70f0e89;hp=bc09adc8099a7f3a531be1ce0c6b2ba71e504b91;hpb=c2adecb31b16a36efdb509a575533c7f103a0576;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/parser/TagHooksTest.php b/tests/phpunit/includes/parser/TagHooksTest.php index bc09adc809..06da7a53f7 100644 --- a/tests/phpunit/includes/parser/TagHooksTest.php +++ b/tests/phpunit/includes/parser/TagHooksTest.php @@ -1,5 +1,7 @@ getContentLanguage() ); return $popt; } @@ -54,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( @@ -73,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( @@ -89,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( @@ -108,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,