mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/TemplateStyles
synced 2024-11-28 02:00:20 +00:00
Merge "Revert "Remove use of WikiPage::doEditContent""
This commit is contained in:
commit
89724e4b64
|
@ -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' ) );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue