Use WikiPage::doUserEditContent() instead of ::doEditContent()

::doUserEditContent() is available since 1.36 as a replacement
for ::doEditContent(), which has been deprecated. Bump the
required version of MediaWiki to 1.36 accordingly.

Results in passing a user where previously the fallback
to $wgUser was being used.

Bug: T255507
Change-Id: I11e4a305e66935ea1d1b4692561fb5d49871a729
This commit is contained in:
DannyS712 2021-06-24 05:57:16 +00:00
parent 047f21264f
commit cd885e83cb
2 changed files with 9 additions and 4 deletions

View file

@ -10,7 +10,7 @@
"license-name": "GPL-2.0-or-later AND MIT",
"type": "parserhook",
"requires": {
"MediaWiki": ">=1.35.0"
"MediaWiki": ">= 1.36.0"
},
"APIModules": {
"scribunto-console": "ApiScribuntoConsole"

View file

@ -38,25 +38,30 @@ class Scribunto_LuaTitleLibraryTest extends Scribunto_LuaEngineTestBase {
] ),
] );
$editor = $this->getTestSysop()->getUser();
// Page for getContent test
$page = WikiPage::factory( Title::newFromText( 'ScribuntoTestPage' ) );
$page->doEditContent(
$page->doUserEditContent(
new WikitextContent(
'{{int:mainpage}}<includeonly>...</includeonly><noinclude>...</noinclude>'
),
$editor,
'Summary'
);
$this->testPageId = $page->getId();
// Pages for redirectTarget tests
$page = WikiPage::factory( Title::newFromText( 'ScribuntoTestRedirect' ) );
$page->doEditContent(
$page->doUserEditContent(
new WikitextContent( '#REDIRECT [[ScribuntoTestTarget]]' ),
$editor,
'Summary'
);
$page = WikiPage::factory( Title::newFromText( 'ScribuntoTestNonRedirect' ) );
$page->doEditContent(
$page->doUserEditContent(
new WikitextContent( 'Not a redirect.' ),
$editor,
'Summary'
);