return $this->mPage->getLastPurgeTimestamp();
}
- /**
- * Call to WikiPage function for backwards compatibility.
- * @see WikiPage::doQuickEditContent
- */
- public function doQuickEditContent(
- Content $content, User $user, $comment = '', $minor = false, $serialFormat = null
- ) {
- return $this->mPage->doQuickEditContent(
- $content, $user, $comment, $minor, $serialFormat
- );
- }
-
/**
* Call to WikiPage function for backwards compatibility.
* @see WikiPage::doViewUpdates
}
}
- /**
- * Edit an article without doing all that other stuff
- * The article must already exist; link tables etc
- * are not updated, caches are not flushed.
- *
- * @param Content $content Content submitted
- * @param User $user The relevant user
- * @param string $comment Comment submitted
- * @param bool $minor Whereas it's a minor modification
- * @param string $serialFormat Format for storing the content in the database
- */
- public function doQuickEditContent(
- Content $content, User $user, $comment = '', $minor = false, $serialFormat = null
- ) {
-
- $serialized = $content->serialize( $serialFormat );
-
- $dbw = wfGetDB( DB_MASTER );
- $revision = new Revision( [
- 'title' => $this->getTitle(), // for determining the default content model
- 'page' => $this->getId(),
- 'user_text' => $user->getName(),
- 'user' => $user->getId(),
- 'text' => $serialized,
- 'length' => $content->getSize(),
- 'comment' => $comment,
- 'minor_edit' => $minor ? 1 : 0,
- ] ); // XXX: set the content object?
- $revision->insertOn( $dbw );
- $this->updateRevisionOn( $dbw, $revision );
-
- Hooks::run( 'NewRevisionFromEditComplete', [ $this, $revision, false, $user ] );
-
- }
-
/**
* Update the article's restriction field, and leave a log entry.
* This works for protection both existing and non-existing pages.
/**
* @covers WikiPage::doEditContent
+ * @covers WikiPage::doModify
+ * @covers WikiPage::doCreate
+ * @covers WikiPage::doEditUpdates
*/
public function testDoEditContent() {
$page = $this->newPage( "WikiPageTest_testDoEditContent" );
$this->assertEquals( 2, $n, 'pagelinks should contain two links from the page' );
}
- /**
- * @covers WikiPage::doQuickEditContent
- */
- public function testDoQuickEditContent() {
- global $wgUser;
-
- $page = $this->createPage(
- "WikiPageTest_testDoQuickEditContent",
- "original text",
- CONTENT_MODEL_WIKITEXT
- );
-
- $content = ContentHandler::makeContent(
- "quick text",
- $page->getTitle(),
- CONTENT_MODEL_WIKITEXT
- );
- $page->doQuickEditContent( $content, $wgUser, "testing q" );
-
- # ---------------------
- $page = new WikiPage( $page->getTitle() );
- $this->assertTrue( $content->equals( $page->getContent() ) );
- }
-
/**
* @covers WikiPage::doDeleteArticle
*/