mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-24 07:54:13 +00:00
Merge "Use WikiPage::doUserEditContent() instead of ::doEditContent()"
This commit is contained in:
commit
39afffb297
|
@ -223,12 +223,10 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
$previousContent = $content->getText();
|
||||
}
|
||||
}
|
||||
$status = $page->doEditContent(
|
||||
$status = $page->doUserEditContent(
|
||||
new WikitextContent( $contentText . $previousContent ),
|
||||
'generating sample notifications',
|
||||
0,
|
||||
false,
|
||||
$agent
|
||||
$agent,
|
||||
'generating sample notifications'
|
||||
);
|
||||
|
||||
if ( !$status->isGood() ) {
|
||||
|
@ -297,7 +295,15 @@ class GenerateSampleNotifications extends Maintenance {
|
|||
true // undoIsLatest
|
||||
);
|
||||
|
||||
$status = $page->doEditContent( $content, 'undo', 0, false, $agent, null, [], $undoRev->getId() );
|
||||
$status = $page->doUserEditContent(
|
||||
$content,
|
||||
$agent,
|
||||
'undo',
|
||||
0, // $flags
|
||||
false, // $originalRevId
|
||||
[], // $tags
|
||||
$undoRev->getId()
|
||||
);
|
||||
|
||||
if ( !$status->isGood() ) {
|
||||
$this->error( "Failed to undo {$moai->getPrefixedText()}: {$status->getMessage()->text()}" );
|
||||
|
|
|
@ -942,9 +942,11 @@ TEXT
|
|||
// pages to be created: templates may be used to ping users (e.g.
|
||||
// {{u|...}}) but if we don't have that template, it just won't work!
|
||||
$pages += [ $title => '' ];
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
foreach ( $pages as $pageTitle => $pageText ) {
|
||||
$template = WikiPage::factory( Title::newFromText( $pageTitle ) );
|
||||
$template->doEditContent( new WikitextContent( $pageText ), '' );
|
||||
$template->doUserEditContent( new WikitextContent( $pageText ), $user, '' );
|
||||
}
|
||||
|
||||
// force i18n messages to be reloaded from MessageCache (from DB, where a new message
|
||||
|
|
|
@ -72,6 +72,6 @@ class MWEchoThankYouEditTest extends MediaWikiTestCase {
|
|||
private function edit( Title $title, User $user, $text ) {
|
||||
$page = WikiPage::factory( $title );
|
||||
$content = ContentHandler::makeContent( $text, $title );
|
||||
$page->doEditContent( $content, 'test', 0, false, $user );
|
||||
$page->doUserEditContent( $content, $user, 'test' );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,12 +108,10 @@ class EchoUserLocatorTest extends MediaWikiTestCase {
|
|||
*/
|
||||
public function testLocateArticleCreator( $message, $initialize ) {
|
||||
list( $expect, $title, $user ) = $initialize();
|
||||
WikiPage::factory( $title )->doEditContent(
|
||||
WikiPage::factory( $title )->doUserEditContent(
|
||||
/* $content = */ ContentHandler::makeContent( 'content', $title ),
|
||||
/* $summary = */ 'summary',
|
||||
/* $flags = */ 0,
|
||||
/* $baseRevId = */ false,
|
||||
/* $user = */ $user
|
||||
/* $user = */ $user,
|
||||
/* $summary = */ 'summary'
|
||||
);
|
||||
|
||||
$event = $this->mockEchoEvent();
|
||||
|
|
Loading…
Reference in a new issue