Merge "Hard deprecate the rest of the Revision class"
This commit is contained in:
commit
8ada06dca1
13 changed files with 100 additions and 40 deletions
|
|
@ -945,7 +945,6 @@ because of Phabricator reports.
|
|||
user is passed, they fallback to $wgUser. Not passing a user when
|
||||
one is needed is deprecated
|
||||
- LogEventsList::getExcludeClause
|
||||
- Revision::getUser
|
||||
- WikiPage::getComment
|
||||
- WikiPage::getCreator
|
||||
- WikiPage::getUser
|
||||
|
|
@ -1013,9 +1012,9 @@ because of Phabricator reports.
|
|||
* WikiPage::onArticleEdit now accepts as its optional second parameter
|
||||
a RevisionRecord object; passing a Revision is hard deprecated.
|
||||
* Global $wgUser variable was soft deprecated.
|
||||
* The Revision class was soft deprecated entirely in 1.31. Specific methods
|
||||
* The Revision class was soft deprecated entirely in 1.31. All methods
|
||||
have now been individually hard deprecated:
|
||||
- ::__construct with either an object or an array
|
||||
- ::__construct - create MutableRevisionRecord objects instead
|
||||
- ::newFromId - use RevisionLookup::getRevisionById instead
|
||||
- ::newFromTitle - use RevisionLookup::getRevisionByTitle instead
|
||||
- ::newFromPageId - use RevisionStore::getRevisionByPageId instead
|
||||
|
|
@ -1027,6 +1026,8 @@ because of Phabricator reports.
|
|||
- ::getQueryInfo - use RevisionStore::getQueryInfo instead
|
||||
- ::getArchiveQueryInfo - use RevisionStore::getArchiveQueryInfo instead
|
||||
- ::getParentLengths - use RevisionStore::getRevisionSizes instead
|
||||
- ::getRevisionRecord - no replacement
|
||||
- ::getId - use RevisionRecord::getId instead
|
||||
- ::setId - use MutableRevisionRecord::setId instead
|
||||
- ::setUserIdAndName - use MutableRevisionRecord::setUser instead
|
||||
- ::getTextId - use SlotRecord::getContentAddress for retrieving an actual
|
||||
|
|
@ -1034,8 +1035,10 @@ because of Phabricator reports.
|
|||
- ::getParentId - use RevisionRecord::getParentId instead
|
||||
- ::getSize - use RevisionRecord::getSize instead
|
||||
- ::getSha1 - use RevisionRecord::getSha1 instead
|
||||
- ::getTitle - use RevisionRecord::getPageAsLinkTarget instead
|
||||
- ::setTitle - the method was previously a no-op
|
||||
- ::getPage - use RevisionRecord::getPageId instead
|
||||
- ::getUser - use RevisionRecord::getUser and then User::getId instead
|
||||
- ::getUserText - use RevisionRecord::getUser and then User::getName instead
|
||||
- ::getComment - use RevisionRecord::getComment instead
|
||||
- ::isMinor - use RevisionRecord::isMinor instead
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ use Wikimedia\Rdbms\IDatabase;
|
|||
|
||||
/**
|
||||
* @deprecated since 1.31, use RevisionRecord, RevisionStore, and BlobStore instead.
|
||||
* Hard deprecated since 1.35
|
||||
*/
|
||||
class Revision implements IDBAccessObject {
|
||||
|
||||
|
|
@ -362,12 +363,13 @@ class Revision implements IDBAccessObject {
|
|||
* @internal
|
||||
*/
|
||||
public function __construct( $row, $queryFlags = 0, Title $title = null ) {
|
||||
wfDeprecated( __METHOD__, '1.31' );
|
||||
|
||||
global $wgUser;
|
||||
|
||||
if ( $row instanceof RevisionRecord ) {
|
||||
$this->mRecord = $row;
|
||||
} elseif ( is_array( $row ) ) {
|
||||
wfDeprecated( __METHOD__ . ' with an array', '1.31' );
|
||||
// If no user is specified, fall back to using the global user object, to stay
|
||||
// compatible with pre-1.31 behavior.
|
||||
if ( !isset( $row['user'] ) && !isset( $row['user_text'] ) ) {
|
||||
|
|
@ -380,7 +382,6 @@ class Revision implements IDBAccessObject {
|
|||
$this->ensureTitle( $row, $queryFlags, $title )
|
||||
);
|
||||
} elseif ( is_object( $row ) ) {
|
||||
wfDeprecated( __METHOD__ . ' with an object', '1.31' );
|
||||
$this->mRecord = self::getRevisionFactory()->newRevisionFromRow(
|
||||
$row,
|
||||
$queryFlags,
|
||||
|
|
@ -441,18 +442,23 @@ class Revision implements IDBAccessObject {
|
|||
}
|
||||
|
||||
/**
|
||||
* @deprecated since 1.31 (soft), 1.35 (hard)
|
||||
* @return RevisionRecord
|
||||
*/
|
||||
public function getRevisionRecord() {
|
||||
wfDeprecated( __METHOD__, '1.31' );
|
||||
return $this->mRecord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get revision ID
|
||||
*
|
||||
* @deprecated since 1.31 (soft), 1.35 (hard)
|
||||
*
|
||||
* @return int|null
|
||||
*/
|
||||
public function getId() {
|
||||
wfDeprecated( __METHOD__, '1.31' );
|
||||
return $this->mRecord->getId();
|
||||
}
|
||||
|
||||
|
|
@ -583,11 +589,14 @@ class Revision implements IDBAccessObject {
|
|||
* Returns the title of the page associated with this entry.
|
||||
* Since 1.31, this will never return null.
|
||||
*
|
||||
* @deprecated since 1.31 (soft), 1.35 (hard)
|
||||
*
|
||||
* Will do a query, when title is not set and id is given.
|
||||
*
|
||||
* @return Title
|
||||
*/
|
||||
public function getTitle() {
|
||||
wfDeprecated( __METHOD__, '1.31' );
|
||||
$linkTarget = $this->mRecord->getPageAsLinkTarget();
|
||||
return Title::newFromLinkTarget( $linkTarget );
|
||||
}
|
||||
|
|
@ -628,6 +637,8 @@ class Revision implements IDBAccessObject {
|
|||
* If the specified audience does not have access to it, zero will be
|
||||
* returned.
|
||||
*
|
||||
* @deprecated since 1.31 (soft), 1.35 (hard)
|
||||
*
|
||||
* @param int $audience One of:
|
||||
* Revision::FOR_PUBLIC to be displayed to all users
|
||||
* Revision::FOR_THIS_USER to be displayed to the given user
|
||||
|
|
@ -637,11 +648,8 @@ class Revision implements IDBAccessObject {
|
|||
* @return int
|
||||
*/
|
||||
public function getUser( $audience = self::FOR_PUBLIC, User $user = null ) {
|
||||
wfDeprecated( __METHOD__, '1.31' );
|
||||
if ( $audience === self::FOR_THIS_USER && !$user ) {
|
||||
wfDeprecated(
|
||||
__METHOD__ . ' using FOR_THIS_USER without a user',
|
||||
'1.35'
|
||||
);
|
||||
global $wgUser;
|
||||
$user = $wgUser;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -277,6 +277,7 @@ class EditPageTest extends MediaWikiLangTestCase {
|
|||
public function testCreatePage(
|
||||
$desc, $pageTitle, $user, $editText, $expectedCode, $expectedText, $ignoreBlank = false
|
||||
) {
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'PageContentInsertComplete hook' );
|
||||
$this->hideDeprecated( 'PageContentSaveComplete hook' );
|
||||
|
||||
|
|
@ -322,6 +323,7 @@ class EditPageTest extends MediaWikiLangTestCase {
|
|||
public function testCreatePageTrx(
|
||||
$desc, $pageTitle, $user, $editText, $expectedCode, $expectedText, $ignoreBlank = false
|
||||
) {
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'PageContentInsertComplete hook' );
|
||||
$this->hideDeprecated( 'PageContentSaveComplete hook' );
|
||||
|
||||
|
|
@ -380,6 +382,7 @@ class EditPageTest extends MediaWikiLangTestCase {
|
|||
* @covers EditPage
|
||||
*/
|
||||
public function testUpdatePage() {
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'PageContentInsertComplete hook' );
|
||||
$this->hideDeprecated( 'PageContentSaveComplete hook' );
|
||||
|
||||
|
|
@ -432,6 +435,7 @@ class EditPageTest extends MediaWikiLangTestCase {
|
|||
* @covers EditPage
|
||||
*/
|
||||
public function testUpdatePageTrx() {
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'PageContentSaveComplete hook' );
|
||||
|
||||
$text = "one";
|
||||
|
|
|
|||
|
|
@ -714,6 +714,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetRecentChange() {
|
||||
$this->hideDeprecated( 'Revision::getRecentChange' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$page = $this->getTestPage();
|
||||
$content = new WikitextContent( __METHOD__ );
|
||||
|
|
@ -2107,6 +2108,7 @@ abstract class RevisionStoreDbTestBase extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContentBlobsForBatch( $slots ) {
|
||||
$this->hideDeprecated( 'Revision::getContentModel' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$page1 = $this->getTestPage();
|
||||
$text = __METHOD__ . 'b-ä';
|
||||
|
|
|
|||
|
|
@ -90,6 +90,13 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
$this->testPage = $this->createPage( __CLASS__, __CLASS__ );
|
||||
}
|
||||
|
||||
// Rather than adding these to all of the individual tests
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
$this->hideDeprecated( 'Revision::getTitle' );
|
||||
$this->hideDeprecated( 'Revision::getUser' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -117,7 +124,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
|
||||
private function makeRevisionWithProps( $props = null ) {
|
||||
$this->hideDeprecated( 'Revision::insertOn' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
if ( $props === null ) {
|
||||
$props = [];
|
||||
|
|
@ -243,7 +249,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
public function testInsertOn_success() {
|
||||
$this->hideDeprecated( 'Revision::getTextId' );
|
||||
$this->hideDeprecated( 'Revision::insertOn' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$parentId = $this->testPage->getLatest();
|
||||
|
||||
|
|
@ -343,7 +348,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testInsertOn_exceptionOnIncomplete( $array, $expException, $expMessage ) {
|
||||
$this->hideDeprecated( 'Revision::insertOn' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
// If an ExternalStore is set don't use it.
|
||||
$this->setMwGlobals( 'wgDefaultExternalStore', false );
|
||||
|
|
@ -837,7 +841,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'Revision::userWasLastToEdit' );
|
||||
$this->hideDeprecated( 'Revision::insertOn' );
|
||||
$this->hideDeprecated( 'Revision::getTimestamp' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$userA = User::newFromName( "RevisionStorageTest_userA" );
|
||||
$userB = User::newFromName( "RevisionStorageTest_userB" );
|
||||
|
||||
|
|
@ -948,8 +951,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
private function newTestRevision( $text, $title = "Test",
|
||||
$model = CONTENT_MODEL_WIKITEXT, $format = null
|
||||
) {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
if ( is_string( $title ) ) {
|
||||
$title = Title::newFromText( $title );
|
||||
}
|
||||
|
|
@ -1000,7 +1001,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContentModelForEmptyRevision() {
|
||||
$this->hideDeprecated( 'Revision::getContentModel' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$rev = new Revision( [], 0, $this->testPage->getTitle() );
|
||||
|
||||
|
|
@ -1042,7 +1042,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'Revision::getContentFormat' );
|
||||
$this->hideDeprecated( 'Revision::getContentHandler' );
|
||||
$this->hideDeprecated( 'Revision::getContentModel' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$rev = new Revision( [], 0, $this->testPage->getTitle() );
|
||||
|
||||
|
|
@ -1123,7 +1122,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContent_failure() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$rev = new Revision( [
|
||||
'page' => $this->testPage->getId(),
|
||||
|
|
@ -1191,7 +1189,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContentClone() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$content = new RevisionTestModifyableContent( "foo" );
|
||||
|
||||
|
|
@ -1429,8 +1426,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers Revision::getTitle
|
||||
*/
|
||||
public function testGetTitle_fromRevisionWhichWillLoadTheTitle() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$rev = new Revision( [ 'id' => $this->testPage->getLatest() ] );
|
||||
$this->assertTrue(
|
||||
$this->testPage->getTitle()->equals(
|
||||
|
|
@ -1785,7 +1780,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testUserCan( $bitField, $field, $userGroups, $expected ) {
|
||||
$this->hideDeprecated( 'Revision::userCan' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$this->setGroupPermissions(
|
||||
[
|
||||
|
|
@ -1809,7 +1803,7 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public function provideGetTextId() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -1843,8 +1837,6 @@ class RevisionDbTest extends MediaWikiIntegrationTestCase {
|
|||
}
|
||||
|
||||
public function provideGetSerializedData() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
$rev = new Revision( [], 0, $title );
|
||||
|
|
|
|||
|
|
@ -17,6 +17,16 @@ use Wikimedia\Rdbms\LoadBalancer;
|
|||
*/
|
||||
class RevisionTest extends MediaWikiIntegrationTestCase {
|
||||
|
||||
protected function setUp() : void {
|
||||
parent::setUp();
|
||||
|
||||
// Rather than adding these to all of the individual tests
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
$this->hideDeprecated( 'Revision::getTitle' );
|
||||
$this->hideDeprecated( 'Revision::getUser' );
|
||||
}
|
||||
|
||||
public function provideConstructFromArray() {
|
||||
yield 'with text' => [
|
||||
[
|
||||
|
|
@ -68,7 +78,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
public function testConstructFromArray( $rowArray ) {
|
||||
$this->hideDeprecated( 'Revision::getContentModel' );
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( $rowArray, 0, $this->getMockTitle() );
|
||||
$this->assertNotNull( $rev->getContent(), 'no content object available' );
|
||||
|
|
@ -82,7 +92,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testConstructFromEmptyArray() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( [], 0, $this->getMockTitle() );
|
||||
$this->assertNull( $rev->getContent(), 'no content object should be available' );
|
||||
|
|
@ -142,7 +152,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
$expectedUserName
|
||||
) {
|
||||
$this->hideDeprecated( 'Revision::getUserText' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$testUser = $this->getTestUser()->getUser();
|
||||
$this->setMwGlobals( 'wgUser', $testUser );
|
||||
|
|
@ -189,7 +199,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
|
||||
*/
|
||||
public function testConstructFromArrayThrowsExceptions( $rowArray, Exception $expectedException ) {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$this->expectException( get_class( $expectedException ) );
|
||||
$this->expectExceptionMessage( $expectedException->getMessage() );
|
||||
|
|
@ -202,7 +212,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
|
||||
*/
|
||||
public function testConstructFromNothing() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$this->expectException( InvalidArgumentException::class );
|
||||
new Revision( [] );
|
||||
|
|
@ -290,7 +300,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers \MediaWiki\Revision\RevisionStore::newMutableRevisionFromArray
|
||||
*/
|
||||
public function testConstructFromRow( array $arrayData, callable $assertions ) {
|
||||
$this->hideDeprecated( 'Revision::__construct with an object' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$row = (object)$arrayData;
|
||||
$rev = new Revision( $row, 0, $this->getMockTitle() );
|
||||
|
|
@ -328,7 +338,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
* @covers Revision::getId
|
||||
*/
|
||||
public function testGetId( $rowArray, $expectedId ) {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( $rowArray, 0, $this->getMockTitle() );
|
||||
$this->assertEquals( $expectedId, $rev->getId() );
|
||||
|
|
@ -345,7 +355,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testSetId( $input, $expected ) {
|
||||
$this->hideDeprecated( 'Revision::setId' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( [], 0, $this->getMockTitle() );
|
||||
$rev->setId( $input );
|
||||
|
|
@ -364,7 +374,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
public function testSetUserIdAndName( $inputId, $expectedId, $name ) {
|
||||
$this->hideDeprecated( 'Revision::setUserIdAndName' );
|
||||
$this->hideDeprecated( 'Revision::getUserText' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( [], 0, $this->getMockTitle() );
|
||||
$rev->setUserIdAndName( $inputId, $name );
|
||||
|
|
@ -384,7 +394,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetParentId( $rowArray, $expected ) {
|
||||
$this->hideDeprecated( 'Revision::getParentId' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$rev = new Revision( $rowArray, 0, $this->getMockTitle() );
|
||||
$this->assertSame( $expected, $rev->getParentId() );
|
||||
|
|
@ -483,6 +493,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'Revision::getComment' );
|
||||
$this->hideDeprecated( 'Revision::getSize' );
|
||||
$this->hideDeprecated( 'Revision::getTimestamp' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( RevisionStore::class . '::loadRevisionFromTitle' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
|
@ -629,6 +640,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetSize() {
|
||||
$this->hideDeprecated( 'Revision::getSize' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -646,6 +658,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetSize_failure() {
|
||||
$this->hideDeprecated( 'Revision::getSize' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -665,6 +678,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetSha1() {
|
||||
$this->hideDeprecated( 'Revision::getSha1' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -683,6 +697,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetSha1_failure() {
|
||||
$this->hideDeprecated( 'Revision::getSha1' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -702,6 +717,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContent() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
@ -720,6 +736,7 @@ class RevisionTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetContent_failure() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$title = $this->getMockTitle();
|
||||
|
||||
|
|
|
|||
|
|
@ -74,6 +74,7 @@ class PageUpdaterTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doCreate status get 'revision'" );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doModify status get 'revision'" );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
|
||||
|
|
@ -180,6 +181,7 @@ class PageUpdaterTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doCreate status get 'revision'" );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doModify status get 'revision'" );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,8 @@ class ApiRevisionDeleteTest extends ApiTestCase {
|
|||
$this->hideDeprecated( 'Revision::newFromId' );
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::getComment' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getUser' );
|
||||
|
||||
$user = self::$users['sysop']->getUser();
|
||||
$revid = array_shift( $this->revs );
|
||||
|
|
|
|||
|
|
@ -60,6 +60,7 @@ class ArticleViewTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetOldId() {
|
||||
$this->hideDeprecated( 'Article::getRevisionFetched' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$revisions = [];
|
||||
$page = $this->getPage( __METHOD__, [ 1 => 'Test A', 2 => 'Test B' ], $revisions );
|
||||
|
|
|
|||
|
|
@ -318,6 +318,8 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetRevision() {
|
||||
$this->hideDeprecated( 'PageArchive::getRevision' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
|
||||
$rev = $this->archivedPage->getRevision( $this->ipRev->getTimestamp() );
|
||||
$this->assertNotNull( $rev );
|
||||
|
|
@ -346,6 +348,8 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetArchivedRevision() {
|
||||
$this->hideDeprecated( 'PageArchive::getArchivedRevision' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
|
||||
$rev = $this->archivedPage->getArchivedRevision( $this->ipRev->getId() );
|
||||
$this->assertNotNull( $rev );
|
||||
|
|
@ -363,6 +367,8 @@ class PageArchiveTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testGetPreviousRevision() {
|
||||
$this->hideDeprecated( 'PageArchive::getPreviousRevision' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
|
||||
$rev = $this->archivedPage->getPreviousRevision( $this->ipRev->getTimestamp() );
|
||||
$this->assertNotNull( $rev );
|
||||
|
|
|
|||
|
|
@ -196,7 +196,8 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
|
|||
*/
|
||||
public function testDoEditUpdates_revision() {
|
||||
$this->hideDeprecated( 'WikiPage::doEditUpdates with a Revision object' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
|
||||
|
|
@ -289,6 +290,9 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
|
|||
$this->hideDeprecated( 'Revision::getRecentChange' );
|
||||
$this->hideDeprecated( 'Revision::getSha1' );
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
$this->hideDeprecated( 'WikiPage::prepareContentForEdit with a Revision object' );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doCreate status get 'revision'" );
|
||||
|
|
@ -780,6 +784,8 @@ class WikiPageDbTest extends MediaWikiLangTestCase {
|
|||
*/
|
||||
public function testGetRevision() {
|
||||
$this->hideDeprecated( 'Revision::getContent' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
|
||||
$page = $this->newPage( __METHOD__ );
|
||||
|
|
@ -1180,6 +1186,8 @@ more stuff
|
|||
* @covers WikiPage::getOldestRevision
|
||||
*/
|
||||
public function testGetOldestRevision() {
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
$this->hideDeprecated( 'WikiPage::getOldestRevision' );
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
|
||||
|
|
@ -1227,6 +1235,8 @@ more stuff
|
|||
public function testDoRollback() {
|
||||
$this->hideDeprecated( 'Revision::countByPageId' );
|
||||
$this->hideDeprecated( 'Revision::getUserText' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doCreate status get 'revision'" );
|
||||
$this->hideDeprecated( "MediaWiki\Storage\PageUpdater::doModify status get 'revision'" );
|
||||
|
||||
|
|
@ -1320,6 +1330,7 @@ more stuff
|
|||
*/
|
||||
public function testDoRollbackFailureSameContent() {
|
||||
$this->hideDeprecated( 'Revision::getSha1' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
|
||||
$admin = $this->getTestSysop()->getUser();
|
||||
|
|
@ -1932,6 +1943,7 @@ more stuff
|
|||
$expectedComment
|
||||
) {
|
||||
$this->hideDeprecated( 'Revision::getComment' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'WikiPage::insertProtectNullRevision' );
|
||||
$this->setContentLang( 'qqx' );
|
||||
|
||||
|
|
@ -1958,7 +1970,9 @@ more stuff
|
|||
public function testUpdateRevisionOn_existingPage() {
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
$this->hideDeprecated( 'WikiPage::updateRevisionOn with a Revision object' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
|
||||
$user = $this->getTestSysop()->getUser();
|
||||
$page = $this->createPage( __METHOD__, 'StartText' );
|
||||
|
|
@ -1991,7 +2005,9 @@ more stuff
|
|||
*/
|
||||
public function testUpdateRevisionOn_NonExistingPage() {
|
||||
$this->hideDeprecated( 'WikiPage::updateRevisionOn with a Revision object' );
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
|
||||
$user = $this->getTestSysop()->getUser();
|
||||
$page = $this->createPage( __METHOD__, 'StartText' );
|
||||
|
|
@ -2022,7 +2038,8 @@ more stuff
|
|||
* @covers WikiPage::updateIfNewerOn
|
||||
*/
|
||||
public function testUpdateIfNewerOn_olderRevision() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'WikiPage::updateIfNewerOn' );
|
||||
|
||||
$user = $this->getTestSysop()->getUser();
|
||||
|
|
@ -2059,7 +2076,8 @@ more stuff
|
|||
* @covers WikiPage::updateIfNewerOn
|
||||
*/
|
||||
public function testUpdateIfNewerOn_newerRevision() {
|
||||
$this->hideDeprecated( 'Revision::__construct with an array' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$this->hideDeprecated( 'WikiPage::updateIfNewerOn' );
|
||||
|
||||
$user = $this->getTestSysop()->getUser();
|
||||
|
|
@ -2453,6 +2471,8 @@ more stuff
|
|||
*/
|
||||
public function testGetDerivedDataUpdater() {
|
||||
$this->hideDeprecated( 'WikiPage::getRevision' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getRevisionRecord' );
|
||||
$admin = $this->getTestSysop()->getUser();
|
||||
|
||||
/** @var object $page */
|
||||
|
|
|
|||
|
|
@ -176,6 +176,7 @@ class ContribsPagerTest extends MediaWikiIntegrationTestCase {
|
|||
*/
|
||||
public function testCreateRevision() {
|
||||
$this->hideDeprecated( 'ContribsPager::tryToCreateValidRevision' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
|
||||
$pager = new ContribsPager( new RequestContext(), [
|
||||
'target' => '116.17.184.5/32',
|
||||
|
|
|
|||
|
|
@ -2797,6 +2797,8 @@ class UserTest extends MediaWikiIntegrationTestCase {
|
|||
$this->hideDeprecated( 'User::getNewMessageLinks' );
|
||||
$this->hideDeprecated( 'User::getNewMessageRevisionId' );
|
||||
$this->hideDeprecated( 'User::setNewtalk' );
|
||||
$this->hideDeprecated( 'Revision::__construct' );
|
||||
$this->hideDeprecated( 'Revision::getId' );
|
||||
|
||||
$user = $this->getTestUser()->getUser();
|
||||
$userTalk = $user->getTalkPage();
|
||||
|
|
|
|||
Loading…
Reference in a new issue