Merge "Hard deprecate Revision::insertOn"

This commit is contained in:
jenkins-bot 2020-05-22 20:42:22 +00:00 committed by Gerrit Code Review
commit a001686895
3 changed files with 11 additions and 0 deletions

View file

@ -896,6 +896,7 @@ because of Phabricator reports.
- ::countByTitle - use RevisionStore::countRevisionsByTitle instead
- ::newFromRow - use RevisionStore::newRevisionFromRow instead
- ::newKnownCurrent - use RevisionStore::getKnownCurrentRevision instead
- ::insertOn - use RevisionStore::insertRevisionOn instead
- ::getParentLengths - use RevisionStore::getRevisionSizes instead
- ::setTitle - the method was previously a no-op
- ::getQueryInfo - use RevisionStore::getQueryInfo instead

View file

@ -954,11 +954,15 @@ class Revision implements IDBAccessObject {
* Insert a new revision into the database, returning the new revision ID
* number on success and dies horribly on failure.
*
* @deprecated since 1.31 (soft), 1.35 (hard)
*
* @param IDatabase $dbw (master connection)
* @throws MWException
* @return int The revision ID
*/
public function insertOn( $dbw ) {
wfDeprecated( __METHOD__, '1.31' );
global $wgUser;
// Note that $this->mRecord->getId() will typically return null here, but not always,

View file

@ -116,6 +116,8 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
}
private function makeRevisionWithProps( $props = null ) {
$this->hideDeprecated( 'Revision::insertOn' );
if ( $props === null ) {
$props = [];
}
@ -230,6 +232,7 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
*/
public function testInsertOn_success() {
$this->hideDeprecated( 'Revision::getTextId' );
$this->hideDeprecated( 'Revision::insertOn' );
$parentId = $this->testPage->getLatest();
@ -328,6 +331,8 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
* @covers Revision::insertOn
*/
public function testInsertOn_exceptionOnIncomplete( $array, $expException, $expMessage ) {
$this->hideDeprecated( 'Revision::insertOn' );
// If an ExternalStore is set don't use it.
$this->setMwGlobals( 'wgDefaultExternalStore', false );
$this->expectException( $expException );
@ -806,6 +811,7 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
*/
public function testUserWasLastToEdit( $sinceIdx, $expectedLast ) {
$this->hideDeprecated( 'Revision::userWasLastToEdit' );
$this->hideDeprecated( 'Revision::insertOn' );
$userA = User::newFromName( "RevisionStorageTest_userA" );
$userB = User::newFromName( "RevisionStorageTest_userB" );