Reedy has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/332933 )

Change subject: Revision::getText() was removed
......................................................................

Revision::getText() was removed

Bug: T154498
Change-Id: I29dcf768a9c176ca27b94359ac99cdc2b5ea930b
---
M RELEASE-NOTES-1.29
M includes/Revision.php
M tests/phpunit/includes/RevisionStorageTest.php
M tests/phpunit/includes/RevisionTest.php
4 files changed, 2 insertions(+), 63 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/33/332933/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index cbfd124..bc5af86 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -201,7 +201,8 @@
   Use ContentHandlerDefaultModelFor instead.
 * Hook TitleIsWikitextPage (deprecated in 1.21) was removed.
   Use ContentHandlerDefaultModelFor instead.
-* Article::getContent (deprecated in 1.21) was removed.
+* Article::getContent() (deprecated in 1.21) was removed.
+* Revision::getText() (deprecated in 1.21) was removed.
 
 == Compatibility ==
 
diff --git a/includes/Revision.php b/includes/Revision.php
index 8721ef9..d9e42ff 100644
--- a/includes/Revision.php
+++ b/includes/Revision.php
@@ -1036,28 +1036,6 @@
        }
 
        /**
-        * Fetch revision text if it's available to the specified audience.
-        * If the specified audience does not have the ability to view this
-        * revision, an empty string will be returned.
-        *
-        * @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
-        *   Revision::RAW              get the text regardless of permissions
-        * @param User $user User object to check for, only if FOR_THIS_USER is 
passed
-        *   to the $audience parameter
-        *
-        * @deprecated since 1.21, use getContent() instead
-        * @return string
-        */
-       public function getText( $audience = self::FOR_PUBLIC, User $user = 
null ) {
-               wfDeprecated( __METHOD__, '1.21' );
-
-               $content = $this->getContent( $audience, $user );
-               return ContentHandler::getContentText( $content ); # returns 
the raw content text, if applicable
-       }
-
-       /**
         * Fetch revision content if it's available to the specified audience.
         * If the specified audience does not have the ability to view this
         * revision, null will be returned.
diff --git a/tests/phpunit/includes/RevisionStorageTest.php 
b/tests/phpunit/includes/RevisionStorageTest.php
index 7d3007b..642ada2 100644
--- a/tests/phpunit/includes/RevisionStorageTest.php
+++ b/tests/phpunit/includes/RevisionStorageTest.php
@@ -275,18 +275,6 @@
        }
 
        /**
-        * @covers Revision::getText
-        */
-       public function testGetText() {
-               $this->hideDeprecated( 'Revision::getText' );
-
-               $orig = $this->makeRevision( [ 'text' => 'hello hello.' ] );
-               $rev = Revision::newFromId( $orig->getId() );
-
-               $this->assertEquals( 'hello hello.', $rev->getText() );
-       }
-
-       /**
         * @covers Revision::getContent
         */
        public function testGetContent_failure() {
diff --git a/tests/phpunit/includes/RevisionTest.php 
b/tests/phpunit/includes/RevisionTest.php
index 767c963..c971a40 100644
--- a/tests/phpunit/includes/RevisionTest.php
+++ b/tests/phpunit/includes/RevisionTest.php
@@ -311,28 +311,6 @@
                );
        }
 
-       function dataGetText() {
-               // NOTE: we expect the help namespace to always contain wikitext
-               return [
-                       [ 'hello world', 'Help:Hello', null, null, 
Revision::FOR_PUBLIC, 'hello world' ],
-                       [ serialize( 'hello world' ), 'Hello', "testing", null, 
Revision::FOR_PUBLIC, null ],
-                       [ serialize( 'hello world' ), 'Dummy:Hello', null, 
null, Revision::FOR_PUBLIC, null ],
-               ];
-       }
-
-       /**
-        * @group Database
-        * @dataProvider dataGetText
-        * @covers Revision::getText
-        */
-       public function testGetText( $text, $title, $model, $format, $audience, 
$expectedText ) {
-               $this->hideDeprecated( 'Revision::getText' );
-
-               $rev = $this->newTestRevision( $text, $title, $model, $format );
-
-               $this->assertEquals( $expectedText, $rev->getText( $audience ) 
);
-       }
-
        public function dataGetSize() {
                return [
                        [ "hello world.", CONTENT_MODEL_WIKITEXT, 12 ],
@@ -375,14 +353,11 @@
         * @covers Revision::__construct
         */
        public function testConstructWithText() {
-               $this->hideDeprecated( "Revision::getText" );
-
                $rev = new Revision( [
                        'text' => 'hello world.',
                        'content_model' => CONTENT_MODEL_JAVASCRIPT
                ] );
 
-               $this->assertNotNull( $rev->getText(), 'no content text' );
                $this->assertNotNull( $rev->getContent(), 'no content object 
available' );
                $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, 
$rev->getContent()->getModel() );
                $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, 
$rev->getContentModel() );
@@ -392,15 +367,12 @@
         * @covers Revision::__construct
         */
        public function testConstructWithContent() {
-               $this->hideDeprecated( "Revision::getText" );
-
                $title = Title::newFromText( 
'RevisionTest_testConstructWithContent' );
 
                $rev = new Revision( [
                        'content' => ContentHandler::makeContent( 'hello 
world.', $title, CONTENT_MODEL_JAVASCRIPT ),
                ] );
 
-               $this->assertNotNull( $rev->getText(), 'no content text' );
                $this->assertNotNull( $rev->getContent(), 'no content object 
available' );
                $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, 
$rev->getContent()->getModel() );
                $this->assertEquals( CONTENT_MODEL_JAVASCRIPT, 
$rev->getContentModel() );

-- 
To view, visit https://gerrit.wikimedia.org/r/332933
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I29dcf768a9c176ca27b94359ac99cdc2b5ea930b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Reedy <re...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to