Reedy has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/324705

Change subject: Article::getAutosummary() and WikiPage::getAutosummary() were 
removed
......................................................................

Article::getAutosummary() and WikiPage::getAutosummary() were removed

Bug: T145728
Change-Id: I233571658b902c93a148a992ea99eb159551e732
---
M RELEASE-NOTES-1.29
M includes/page/Article.php
M includes/page/WikiPage.php
M tests/phpunit/includes/page/ArticleTest.php
M tests/phpunit/includes/page/WikiPageTest.php
5 files changed, 4 insertions(+), 95 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/05/324705/1

diff --git a/RELEASE-NOTES-1.29 b/RELEASE-NOTES-1.29
index 21a94c5..dcad6ac 100644
--- a/RELEASE-NOTES-1.29
+++ b/RELEASE-NOTES-1.29
@@ -58,6 +58,10 @@
   required as all sessions are stored in Object Cache now.
 * MWHttpRequest::execute() should be considered to return a StatusValue; the
   Status return type is deprecated.
+* WikiRevision::getText(), Article::getText() and Article::prepareTextForEdit()
+  (deprecated in 1.21) were removed.
+* Article::getAutosummary() and WikiPage::getAutosummary (deprecated in 1.21)
+  were removed.
 
 == Compatibility ==
 
diff --git a/includes/page/Article.php b/includes/page/Article.php
index ac363b2..d30f034 100644
--- a/includes/page/Article.php
+++ b/includes/page/Article.php
@@ -2725,15 +2725,5 @@
                WikiPage::onArticleEdit( $title );
        }
 
-       /**
-        * @param string $oldtext
-        * @param string $newtext
-        * @param int $flags
-        * @return string
-        * @deprecated since 1.21, use ContentHandler::getAutosummary() instead
-        */
-       public static function getAutosummary( $oldtext, $newtext, $flags ) {
-               return WikiPage::getAutosummary( $oldtext, $newtext, $flags );
-       }
        // ******
 }
diff --git a/includes/page/WikiPage.php b/includes/page/WikiPage.php
index f016494..284a343 100644
--- a/includes/page/WikiPage.php
+++ b/includes/page/WikiPage.php
@@ -3520,28 +3520,6 @@
        }
 
        /**
-        * Return an applicable autosummary if one exists for the given edit.
-        * @param string|null $oldtext The previous text of the page.
-        * @param string|null $newtext The submitted text of the page.
-        * @param int $flags Bitmask: a bitmask of flags submitted for the edit.
-        * @return string An appropriate autosummary, or an empty string.
-        *
-        * @deprecated since 1.21, use ContentHandler::getAutosummary() instead
-        */
-       public static function getAutosummary( $oldtext, $newtext, $flags ) {
-               // NOTE: stub for backwards-compatibility. assumes the given 
text is
-               // wikitext. will break horribly if it isn't.
-
-               wfDeprecated( __METHOD__, '1.21' );
-
-               $handler = ContentHandler::getForModelID( 
CONTENT_MODEL_WIKITEXT );
-               $oldContent = is_null( $oldtext ) ? null : 
$handler->unserializeContent( $oldtext );
-               $newContent = is_null( $newtext ) ? null : 
$handler->unserializeContent( $newtext );
-
-               return $handler->getAutosummary( $oldContent, $newContent, 
$flags );
-       }
-
-       /**
         * Auto-generates a deletion reason
         *
         * @param bool &$hasHistory Whether the page has a history
diff --git a/tests/phpunit/includes/page/ArticleTest.php 
b/tests/phpunit/includes/page/ArticleTest.php
index a96a296..7d0813d 100644
--- a/tests/phpunit/includes/page/ArticleTest.php
+++ b/tests/phpunit/includes/page/ArticleTest.php
@@ -63,13 +63,9 @@
         * @covers Article::onArticleCreate
         * @covers Article::onArticleDelete
         * @covers Article::onArticleEdit
-        * @covers Article::getAutosummary
         */
        public function testStaticFunctions() {
                $this->hideDeprecated( 'Article::selectFields' );
-               $this->hideDeprecated( 'Article::getAutosummary' );
-               $this->hideDeprecated( 'WikiPage::getAutosummary' );
-               $this->hideDeprecated( 'CategoryPage::getAutosummary' ); // 
Inherited from Article
 
                $this->assertEquals( WikiPage::selectFields(), 
Article::selectFields(),
                        "Article static functions" );
@@ -78,8 +74,6 @@
                $this->assertEquals( true, is_callable( 
"Article::onArticleDelete" ),
                        "Article static functions" );
                $this->assertEquals( true, is_callable( 
"ImagePage::onArticleEdit" ),
-                       "Article static functions" );
-               $this->assertTrue( is_string( CategoryPage::getAutosummary( '', 
'', 0 ) ),
                        "Article static functions" );
        }
 }
diff --git a/tests/phpunit/includes/page/WikiPageTest.php 
b/tests/phpunit/includes/page/WikiPageTest.php
index 4b7ebd3..49d9fd2 100644
--- a/tests/phpunit/includes/page/WikiPageTest.php
+++ b/tests/phpunit/includes/page/WikiPageTest.php
@@ -1034,63 +1034,6 @@
                $this->assertEquals( "one", 
$page->getContent()->getNativeData() );
        }
 
-       public static function provideGetAutosummary() {
-               return [
-                       [
-                               'Hello there, world!',
-                               '#REDIRECT [[Foo]]',
-                               0,
-                               '/^Redirected page .*Foo/'
-                       ],
-
-                       [
-                               null,
-                               'Hello world!',
-                               EDIT_NEW,
-                               '/^Created page .*Hello/'
-                       ],
-
-                       [
-                               'Hello there, world!',
-                               '',
-                               0,
-                               '/^Blanked/'
-                       ],
-
-                       [
-                               'Lorem ipsum dolor sit amet, consetetur 
sadipscing elitr, sed diam nonumy
-                               eirmod tempor invidunt ut labore et dolore 
magna aliquyam erat, sed diam
-                               voluptua. At vero eos et accusam et justo duo 
dolores et ea rebum. Stet
-                               clita kasd gubergren, no sea takimata sanctus 
est Lorem ipsum dolor sit amet.',
-                               'Hello world!',
-                               0,
-                               '/^Replaced .*Hello/'
-                       ],
-
-                       [
-                               'foo',
-                               'bar',
-                               0,
-                               '/^$/'
-                       ],
-               ];
-       }
-
-       /**
-        * @dataProvider provideGetAutoSummary
-        * @covers WikiPage::getAutosummary
-        */
-       public function testGetAutosummary( $old, $new, $flags, $expected ) {
-               $this->hideDeprecated( "WikiPage::getAutosummary" );
-
-               $page = $this->newPage( "WikiPageTest_testGetAutosummary" );
-
-               $summary = $page->getAutosummary( $old, $new, $flags );
-
-               $this->assertTrue( (bool)preg_match( $expected, $summary ),
-                       "Autosummary didn't match expected pattern $expected: 
$summary" );
-       }
-
        public static function provideGetAutoDeleteReason() {
                return [
                        [

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I233571658b902c93a148a992ea99eb159551e732
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