mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-27 17:50:06 +00:00
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:
parent
047f21264f
commit
cd885e83cb
|
@ -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"
|
||||
|
|
|
@ -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'
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue