Revert "Remove use of WikiPage::doEditContent"

This reverts commit eb94a40c3e.

Reason for revert: autopatrol status wasn't included in the
use of PageUpdater, revert for now and reapply properly with
autopatrol later.

Bug: T252179
Change-Id: I38e29e607bc01146ccab00ef8e10d59b769e4044
This commit is contained in:
DannyS712 2020-05-08 00:16:42 +00:00
parent eb94a40c3e
commit 9f3832efdf

View file

@ -1,7 +1,6 @@
<?php
use MediaWiki\MediaWikiServices;
use MediaWiki\Revision\SlotRecord;
/**
* @group TemplateStyles
@ -14,19 +13,11 @@ class TemplateStylesHooksTest extends MediaWikiLangTestCase {
$title = Title::newFromText( 'Template:TemplateStyles test/' . $page );
$content = ContentHandler::makeContent( $text, $title, $model );
$wikipage = WikiPage::factory( $title );
$page = WikiPage::factory( $title );
$user = static::getTestSysop()->getUser();
$summary = CommentStoreComment::newUnsavedComment( 'Test for TemplateStyles' );
$updater = $wikipage->newPageUpdater( $user );
$updater->setContent(
SlotRecord::MAIN,
$content
);
$updater->saveRevision( $summary );
if ( !$updater->wasSuccessful() ) {
$this->fail( "Failed to create $title." );
$status = $page->doEditContent( $content, 'Test for TemplateStyles', 0, false, $user );
if ( !$status->isOk() ) {
$this->fail( "Failed to create $title: " . $status->getWikiText( false, false, 'en' ) );
}
}