X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fparser%2FTagHooksTest.php;h=06da7a53f709964064d8b58b3e7d191675406fab;hb=8ef8af4244f0736b7b0c2bf6273b6c0e7e97a693;hp=2fdaa1892fccd36987880ede7426ce39de6c09ad;hpb=6e62381aaa2e0d0ee572e3827800d05d9a5c67a4;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,