From d2fa6856a8e49917de3b138ed4065611ce9a2e77 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 13 Jan 2016 20:38:12 +0100 Subject: [PATCH] Remove Revision::getRawText() Bug: T122754 Depends-On: I742f02021959587edd83a4cfb25e0338d05a8e81 Depends-On: I10283802c26b99d7e345c5c06d59c4ea24002e52 Depends-On: I6da4fab1e0e8f698b824e977dd2336e4415ae1ba Change-Id: Id1cfda59e381673be99d9561c9997c0baf26d425 --- RELEASE-NOTES-1.27 | 1 + docs/contenthandler.txt | 2 +- includes/Revision.php | 13 ------------- tests/phpunit/includes/RevisionStorageTest.php | 12 ------------ tests/phpunit/includes/RevisionTest.php | 13 ------------- 5 files changed, 2 insertions(+), 39 deletions(-) diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27 index e8924ef0ee..a882ccc9e3 100644 --- a/RELEASE-NOTES-1.27 +++ b/RELEASE-NOTES-1.27 @@ -379,6 +379,7 @@ changes to languages because of Phabricator reports. * Unit tests don't work with external PHPUnit anymore, Composer is now the only supported way. Run `composer install` to install it and other dev dependencies to run unit tests. * wl_id field added to the watchlist table. +* Revision::getRawText() was removed (deprecated since 1.21). == Compatibility == diff --git a/docs/contenthandler.txt b/docs/contenthandler.txt index f1f478ef31..6209b1426c 100644 --- a/docs/contenthandler.txt +++ b/docs/contenthandler.txt @@ -96,7 +96,7 @@ used. Most importantly, the following functions have been deprecated: -* Revisions::getText() and Revisions::getRawText() is deprecated in favor Revisions::getContent() +* Revisions::getText() is deprecated in favor Revisions::getContent() * WikiPage::getText() is deprecated in favor WikiPage::getContent() Also, the old Article::getContent() (which returns text) is superceded by Article::getContentObject(). However, both diff --git a/includes/Revision.php b/includes/Revision.php index b7bb346844..79cab79f94 100644 --- a/includes/Revision.php +++ b/includes/Revision.php @@ -1035,19 +1035,6 @@ class Revision implements IDBAccessObject { } } - /** - * Fetch revision text without regard for view restrictions - * - * @return string - * - * @deprecated since 1.21. Instead, use Revision::getContent( Revision::RAW ) - * or Revision::getSerializedData() as appropriate. - */ - public function getRawText() { - ContentHandler::deprecated( __METHOD__, "1.21" ); - return $this->getText( self::RAW ); - } - /** * Fetch original serialized data without regard for view restrictions * diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 0ac9c3c46b..7d3007bf40 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -314,18 +314,6 @@ class RevisionStorageTest extends MediaWikiTestCase { $this->assertEquals( 'hello hello.', $rev->getContent()->getNativeData() ); } - /** - * @covers Revision::getRawText - */ - public function testGetRawText() { - $this->hideDeprecated( 'Revision::getRawText' ); - - $orig = $this->makeRevision( [ 'text' => 'hello hello raw.' ] ); - $rev = Revision::newFromId( $orig->getId() ); - - $this->assertEquals( 'hello hello raw.', $rev->getRawText() ); - } - /** * @covers Revision::getContentModel */ diff --git a/tests/phpunit/includes/RevisionTest.php b/tests/phpunit/includes/RevisionTest.php index d2eb6b8df1..767c963b66 100644 --- a/tests/phpunit/includes/RevisionTest.php +++ b/tests/phpunit/includes/RevisionTest.php @@ -333,19 +333,6 @@ class RevisionTest extends MediaWikiTestCase { $this->assertEquals( $expectedText, $rev->getText( $audience ) ); } - /** - * @group Database - * @dataProvider dataGetText - * @covers Revision::getRawText - */ - public function testGetRawText( $text, $title, $model, $format, $audience, $expectedText ) { - $this->hideDeprecated( 'Revision::getRawText' ); - - $rev = $this->newTestRevision( $text, $title, $model, $format ); - - $this->assertEquals( $expectedText, $rev->getRawText( $audience ) ); - } - public function dataGetSize() { return [ [ "hello world.", CONTENT_MODEL_WIKITEXT, 12 ], -- 2.20.1