mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Scribunto
synced 2024-11-24 00:05:00 +00:00
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:
parent
602cef87e0
commit
a34a51fa47
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue