Merge "Replace WikiPage::doEdit() usages"

This commit is contained in:
jenkins-bot 2016-09-15 21:38:10 +00:00 committed by Gerrit Code Review
commit 2979f6e7cf
6 changed files with 21 additions and 5 deletions

View file

@ -3258,7 +3258,7 @@ class Title implements LinkTarget {
* This clears some fields in this object, and clears any associated
* keys in the "bad links" section of the link cache.
*
* - This is called from WikiPage::doEdit() and WikiPage::insertOn() to allow
* - This is called from WikiPage::doEditContent() and WikiPage::insertOn() to allow
* loading of the new page_id. It's also called from
* WikiPage::doDeleteArticleReal()
*

View file

@ -532,7 +532,7 @@ class ApiEditPage extends ApiBase {
case EditPage::AS_END:
default:
// $status came from WikiPage::doEdit()
// $status came from WikiPage::doEditContent()
$errors = $status->getErrorsArray();
$this->dieUsageMsg( $errors[0] ); // TODO: Add new errors to message map
break;

View file

@ -20,7 +20,11 @@ class ApiQueryAllPagesTest extends ApiTestCase {
public function testPrefixNormalizationSearchBug() {
$title = Title::newFromText( 'Category:Template:xyz' );
$page = WikiPage::factory( $title );
$page->doEdit( 'Some text', 'inserting content' );
$page->doEditContent(
ContentHandler::makeContent( 'Some text', $page->getTitle() ),
'inserting content'
);
$result = $this->doApiRequest( [
'action' => 'query',

View file

@ -15,7 +15,11 @@ class ApiQueryRevisionsTest extends ApiTestCase {
$pageName = 'Help:' . __METHOD__;
$title = Title::newFromText( $pageName );
$page = WikiPage::factory( $title );
$page->doEdit( 'Some text', 'inserting content' );
$page->doEditContent(
ContentHandler::makeContent( 'Some text', $page->getTitle() ),
'inserting content'
);
$apiResult = $this->doApiRequest( [
'action' => 'query',

View file

@ -154,6 +154,7 @@ class WikiPageTest extends MediaWikiLangTestCase {
/**
* @covers WikiPage::doEdit
* @deprecated since 1.21. Should be removed when WikiPage::doEdit() gets removed
*/
public function testDoEdit() {
$this->hideDeprecated( "WikiPage::doEdit" );

View file

@ -269,7 +269,14 @@ class UserTest extends MediaWikiTestCase {
// let the user have a few (3) edits
$page = WikiPage::factory( Title::newFromText( 'Help:UserTest_EditCount' ) );
for ( $i = 0; $i < 3; $i++ ) {
$page->doEdit( (string)$i, 'test', 0, false, $user );
$page->doEditContent(
ContentHandler::makeContent( (string)$i, $page->getTitle() ),
'test',
0,
false,
$user
);
}
$this->assertEquals(