[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revision::getText() was removed

2017-01-18 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
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(-)

Approvals:
  Daniel Kinzler: Looks good to me, approved
  jenkins-bot: Verified



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_USERto 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.',

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Revision::getText() was removed

2017-01-18 Thread Reedy (Code Review)
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_USERto 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.',