mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateStyles
synced 2024-11-15 03:35:47 +00:00
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:
parent
eb94a40c3e
commit
9f3832efdf
|
@ -1,7 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
use MediaWiki\MediaWikiServices;
|
use MediaWiki\MediaWikiServices;
|
||||||
use MediaWiki\Revision\SlotRecord;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @group TemplateStyles
|
* @group TemplateStyles
|
||||||
|
@ -14,19 +13,11 @@ class TemplateStylesHooksTest extends MediaWikiLangTestCase {
|
||||||
$title = Title::newFromText( 'Template:TemplateStyles test/' . $page );
|
$title = Title::newFromText( 'Template:TemplateStyles test/' . $page );
|
||||||
$content = ContentHandler::makeContent( $text, $title, $model );
|
$content = ContentHandler::makeContent( $text, $title, $model );
|
||||||
|
|
||||||
$wikipage = WikiPage::factory( $title );
|
$page = WikiPage::factory( $title );
|
||||||
$user = static::getTestSysop()->getUser();
|
$user = static::getTestSysop()->getUser();
|
||||||
$summary = CommentStoreComment::newUnsavedComment( 'Test for TemplateStyles' );
|
$status = $page->doEditContent( $content, 'Test for TemplateStyles', 0, false, $user );
|
||||||
|
if ( !$status->isOk() ) {
|
||||||
$updater = $wikipage->newPageUpdater( $user );
|
$this->fail( "Failed to create $title: " . $status->getWikiText( false, false, 'en' ) );
|
||||||
$updater->setContent(
|
|
||||||
SlotRecord::MAIN,
|
|
||||||
$content
|
|
||||||
);
|
|
||||||
$updater->saveRevision( $summary );
|
|
||||||
|
|
||||||
if ( !$updater->wasSuccessful() ) {
|
|
||||||
$this->fail( "Failed to create $title." );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue