File tree Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Expand file tree Collapse file tree 2 files changed +4
-5
lines changed Original file line number Diff line number Diff line change 7
7
use Maps \GeoJsonPages \GeoJsonContent ;
8
8
use Maps \Tests \MapsTestFactory ;
9
9
use Maps \Tests \TestDoubles \ImageValueObject ;
10
+ use MediaWiki \MediaWikiServices ;
10
11
use PHPUnit \Framework \TestCase ;
11
12
12
13
/**
@@ -36,7 +37,7 @@ public function testMapIdIsSet() {
36
37
}
37
38
38
39
private function parse ( string $ textToParse ): string {
39
- $ parser = new \ Parser ();
40
+ $ parser = MediaWikiServices:: getInstance ()-> getParser ();
40
41
41
42
return $ parser ->parse ( $ textToParse , \Title::newMainPage (), new \ParserOptions () )->getText ();
42
43
}
Original file line number Diff line number Diff line change 5
5
namespace Maps \Tests \Integration \ParserHooks ;
6
6
7
7
use Maps \MapsFactory ;
8
+ use MediaWiki \MediaWikiServices ;
8
9
use ParamProcessor \Processor ;
9
10
use PHPUnit \Framework \TestCase ;
10
11
@@ -39,10 +40,7 @@ public abstract function parametersProvider();
39
40
public function testRender ( array $ parameters , $ expected = null ) {
40
41
$ parserHook = $ this ->getInstance ();
41
42
42
- $ parser = new \Parser ();
43
- $ parser ->mOptions = new \ParserOptions ();
44
- $ parser ->clearState ();
45
- $ parser ->setTitle ( \Title::newMainPage () );
43
+ $ parser = MediaWikiServices::getInstance ()->getParser ();
46
44
47
45
$ renderResult = call_user_func_array (
48
46
[ $ parserHook , 'renderFunction ' ],
You can’t perform that action at this time.
0 commit comments