Avoid using WikiPage::factory()

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

Bug: T297688
Change-Id: I63bf3ba1c2ad6f8b59d369d91777af0418746a6b
This commit is contained in:
Alexander Vorwerk 2021-12-16 22:19:15 +01:00 committed by Zabe
parent b33485da62
commit 9a1ce6e392

View file

@ -26,7 +26,6 @@ use MediaWiki\Linter\LintError;
use MediaWiki\Linter\RecordLintJob; use MediaWiki\Linter\RecordLintJob;
use Title; use Title;
use User; use User;
use WikiPage;
/** /**
* @group Database * @group Database
@ -47,7 +46,7 @@ class RecordLintJobTest extends \MediaWikiIntegrationTestCase {
if ( $user->getId() === 0 ) { if ( $user->getId() === 0 ) {
$user->addToDatabase(); $user->addToDatabase();
} }
$page = WikiPage::factory( $title ); $page = $this->getServiceContainer()->getWikiPageFactory()->newFromTitle( $title );
$content = ContentHandler::makeContent( $baseText, $title ); $content = ContentHandler::makeContent( $baseText, $title );
$page->doUserEditContent( $content, $user, "base text for test" ); $page->doUserEditContent( $content, $user, "base text for test" );