* 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()
*
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;
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',
$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',
/**
* @covers WikiPage::doEdit
+ * @deprecated since 1.21. Should be removed when WikiPage::doEdit() gets removed
*/
public function testDoEdit() {
$this->hideDeprecated( "WikiPage::doEdit" );
// 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(