Article::getAutosummary() and WikiPage::getAutosummary() were removed
authorReedy <reedy@wikimedia.org>
Thu, 1 Dec 2016 12:45:36 +0000 (12:45 +0000)
committerReedy <reedy@wikimedia.org>
Sat, 3 Dec 2016 12:16:41 +0000 (12:16 +0000)
Bug: T145728
Change-Id: I233571658b902c93a148a992ea99eb159551e732

RELEASE-NOTES-1.29
includes/page/Article.php
includes/page/WikiPage.php
tests/phpunit/includes/page/ArticleTest.php
tests/phpunit/includes/page/WikiPageTest.php

index caa35ef..ab7cdd4 100644 (file)
@@ -62,6 +62,8 @@ changes to languages because of Phabricator reports.
 * Xml::escapeJsString() (deprecated in 1.21) was removed.
 * Article::getText() and Article::prepareTextForEdit() (deprecated in 1.21)
   were removed.
 * Xml::escapeJsString() (deprecated in 1.21) was removed.
 * Article::getText() and Article::prepareTextForEdit() (deprecated in 1.21)
   were removed.
+* Article::getAutosummary() and WikiPage::getAutosummary (deprecated in 1.21)
+  were removed.
 
 == Compatibility ==
 
 
 == Compatibility ==
 
index ac363b2..d30f034 100644 (file)
@@ -2725,15 +2725,5 @@ class Article implements Page {
                WikiPage::onArticleEdit( $title );
        }
 
                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 );
-       }
        // ******
 }
        // ******
 }
index f016494..284a343 100644 (file)
@@ -3519,28 +3519,6 @@ class WikiPage implements Page, IDBAccessObject {
                return $result;
        }
 
                return $result;
        }
 
-       /**
-        * 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
         *
        /**
         * Auto-generates a deletion reason
         *
index a96a296..7d0813d 100644 (file)
@@ -63,13 +63,9 @@ class ArticleTest extends MediaWikiTestCase {
         * @covers Article::onArticleCreate
         * @covers Article::onArticleDelete
         * @covers Article::onArticleEdit
         * @covers Article::onArticleCreate
         * @covers Article::onArticleDelete
         * @covers Article::onArticleEdit
-        * @covers Article::getAutosummary
         */
        public function testStaticFunctions() {
                $this->hideDeprecated( 'Article::selectFields' );
         */
        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" );
 
                $this->assertEquals( WikiPage::selectFields(), Article::selectFields(),
                        "Article static functions" );
@@ -79,7 +75,5 @@ class ArticleTest extends MediaWikiTestCase {
                        "Article static functions" );
                $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ),
                        "Article static functions" );
                        "Article static functions" );
                $this->assertEquals( true, is_callable( "ImagePage::onArticleEdit" ),
                        "Article static functions" );
-               $this->assertTrue( is_string( CategoryPage::getAutosummary( '', '', 0 ) ),
-                       "Article static functions" );
        }
 }
        }
 }
index 4b7ebd3..49d9fd2 100644 (file)
@@ -1034,63 +1034,6 @@ more stuff
                $this->assertEquals( "one", $page->getContent()->getNativeData() );
        }
 
                $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 [
                        [
        public static function provideGetAutoDeleteReason() {
                return [
                        [