Avoid using WikiPage::factory()

WikiPage::factory() is deprecated since 1.36 and should be replaced
with WikiPageFactory::newFromTitle().

Bug: T297688
Change-Id: Ie333c616c46a71430f8c18db85bdd64c13379ef0
This commit is contained in:
Alexander Vorwerk 2021-12-16 22:03:32 +01:00 committed by jenkins-bot
parent 602cef87e0
commit a34a51fa47

View file

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