Avoid using WikiPage::factory()

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

Bug: T297688
Change-Id: I6c754b872c3b60ad724af8c18faacbf7320579fa
This commit is contained in:
Alexander Vorwerk 2021-12-16 21:54:21 +01:00
parent a2f5b987a7
commit 57a1d0196b

View file

@ -16,7 +16,7 @@ class TemplateStylesHooksTest extends MediaWikiLangTestCase {
$title = Title::newFromText( 'Template:TemplateStyles test/' . $page );
$content = ContentHandler::makeContent( $text, $title, $model );
$page = WikiPage::factory( $title );
$page = $this->getServiceContainer()->getWikiPageFactory()->newFromTitle( $title );
$user = static::getTestSysop()->getUser();
$status = $page->doUserEditContent( $content, $user, 'Test for TemplateStyles' );
if ( !$status->isOk() ) {