Skip to content

Commit 03cd78e

Browse files
committed
Fix deprecation warnings in tests
1 parent 064f373 commit 03cd78e

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

tests/Integration/Parser/DisplayMapTest.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Maps\GeoJsonPages\GeoJsonContent;
88
use Maps\Tests\MapsTestFactory;
99
use Maps\Tests\TestDoubles\ImageValueObject;
10+
use MediaWiki\MediaWikiServices;
1011
use PHPUnit\Framework\TestCase;
1112

1213
/**
@@ -36,7 +37,7 @@ public function testMapIdIsSet() {
3637
}
3738

3839
private function parse( string $textToParse ): string {
39-
$parser = new \Parser();
40+
$parser = MediaWikiServices::getInstance()->getParser();
4041

4142
return $parser->parse( $textToParse, \Title::newMainPage(), new \ParserOptions() )->getText();
4243
}

tests/Integration/ParserHooks/ParserHookTest.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
namespace Maps\Tests\Integration\ParserHooks;
66

77
use Maps\MapsFactory;
8+
use MediaWiki\MediaWikiServices;
89
use ParamProcessor\Processor;
910
use PHPUnit\Framework\TestCase;
1011

@@ -39,10 +40,7 @@ public abstract function parametersProvider();
3940
public function testRender( array $parameters, $expected = null ) {
4041
$parserHook = $this->getInstance();
4142

42-
$parser = new \Parser();
43-
$parser->mOptions = new \ParserOptions();
44-
$parser->clearState();
45-
$parser->setTitle( \Title::newMainPage() );
43+
$parser = MediaWikiServices::getInstance()->getParser();
4644

4745
$renderResult = call_user_func_array(
4846
[ $parserHook, 'renderFunction' ],

0 commit comments

Comments
 (0)