Ensure calls to Title::getArticleID use the same case as the definition
authorThalia <thalia.e.chan@googlemail.com>
Wed, 6 Feb 2019 22:15:05 +0000 (22:15 +0000)
committerThalia <thalia.e.chan@googlemail.com>
Wed, 6 Feb 2019 22:15:05 +0000 (22:15 +0000)
Change-Id: Ic92f43c9e9df2782ba20aa28ad9e6d2ef7976d2e

includes/specials/SpecialBlock.php
maintenance/populateArchiveRevId.php
tests/phpunit/includes/api/ApiComparePagesTest.php
tests/phpunit/includes/api/ApiMoveTest.php
tests/phpunit/includes/block/Restriction/PageRestrictionTest.php
tests/phpunit/includes/specials/pagers/BlockListPagerTest.php

index 4321cde..9c8882b 100644 (file)
@@ -871,7 +871,7 @@ class SpecialBlock extends FormSpecialPage {
                                        $title = Title::newFromText( $text );
                                        // Use the link cache since the title has already been loaded when
                                        // the field was validated.
-                                       $restriction = new PageRestriction( 0, $title->getArticleId() );
+                                       $restriction = new PageRestriction( 0, $title->getArticleID() );
                                        $restriction->setTitle( $title );
                                        return $restriction;
                                }, explode( "\n", $data['PageRestrictions'] ) );
index 6eb2d6d..ec2eff4 100644 (file)
@@ -198,7 +198,7 @@ class PopulateArchiveRevId extends LoggedUpdateMaintenance {
                $rev = null;
 
                $mainPage = Title::newMainPage();
-               $pageId = $mainPage ? $mainPage->getArticleId() : null;
+               $pageId = $mainPage ? $mainPage->getArticleID() : null;
                if ( $pageId ) {
                        $rev = $dbw->selectRow(
                                'revision',
index 7bab542..9e18eb0 100644 (file)
@@ -44,37 +44,37 @@ class ApiComparePagesTest extends ApiTestCase {
                self::$repl['revA2'] = $this->addPage( 'A', 'A 2' );
                self::$repl['revA3'] = $this->addPage( 'A', 'A 3' );
                self::$repl['revA4'] = $this->addPage( 'A', 'A 4' );
-               self::$repl['pageA'] = Title::newFromText( 'ApiComparePagesTest A' )->getArticleId();
+               self::$repl['pageA'] = Title::newFromText( 'ApiComparePagesTest A' )->getArticleID();
 
                self::$repl['revB1'] = $this->addPage( 'B', 'B 1' );
                self::$repl['revB2'] = $this->addPage( 'B', 'B 2' );
                self::$repl['revB3'] = $this->addPage( 'B', 'B 3' );
                self::$repl['revB4'] = $this->addPage( 'B', 'B 4' );
-               self::$repl['pageB'] = Title::newFromText( 'ApiComparePagesTest B' )->getArticleId();
+               self::$repl['pageB'] = Title::newFromText( 'ApiComparePagesTest B' )->getArticleID();
 
                self::$repl['revC1'] = $this->addPage( 'C', 'C 1' );
                self::$repl['revC2'] = $this->addPage( 'C', 'C 2' );
                self::$repl['revC3'] = $this->addPage( 'C', 'C 3' );
-               self::$repl['pageC'] = Title::newFromText( 'ApiComparePagesTest C' )->getArticleId();
+               self::$repl['pageC'] = Title::newFromText( 'ApiComparePagesTest C' )->getArticleID();
 
                $id = $this->addPage( 'D', 'D 1' );
-               self::$repl['pageD'] = Title::newFromText( 'ApiComparePagesTest D' )->getArticleId();
+               self::$repl['pageD'] = Title::newFromText( 'ApiComparePagesTest D' )->getArticleID();
                wfGetDB( DB_MASTER )->delete( 'revision', [ 'rev_id' => $id ] );
 
                self::$repl['revE1'] = $this->addPage( 'E', 'E 1' );
                self::$repl['revE2'] = $this->addPage( 'E', 'E 2' );
                self::$repl['revE3'] = $this->addPage( 'E', 'E 3' );
                self::$repl['revE4'] = $this->addPage( 'E', 'E 4' );
-               self::$repl['pageE'] = Title::newFromText( 'ApiComparePagesTest E' )->getArticleId();
+               self::$repl['pageE'] = Title::newFromText( 'ApiComparePagesTest E' )->getArticleID();
                wfGetDB( DB_MASTER )->update(
                        'page', [ 'page_latest' => 0 ], [ 'page_id' => self::$repl['pageE'] ]
                );
 
                self::$repl['revF1'] = $this->addPage( 'F', "== Section 1 ==\nF 1.1\n\n== Section 2 ==\nF 1.2" );
-               self::$repl['pageF'] = Title::newFromText( 'ApiComparePagesTest F' )->getArticleId();
+               self::$repl['pageF'] = Title::newFromText( 'ApiComparePagesTest F' )->getArticleID();
 
                self::$repl['revG1'] = $this->addPage( 'G', "== Section 1 ==\nG 1.1", CONTENT_MODEL_TEXT );
-               self::$repl['pageG'] = Title::newFromText( 'ApiComparePagesTest G' )->getArticleId();
+               self::$repl['pageG'] = Title::newFromText( 'ApiComparePagesTest G' )->getArticleID();
 
                WikiPage::factory( Title::newFromText( 'ApiComparePagesTest C' ) )
                        ->doDeleteArticleReal( 'Test for ApiComparePagesTest' );
index 3fa8539..1e66a7d 100644 (file)
@@ -36,7 +36,7 @@ class ApiMoveTest extends ApiTestCase {
                        $this->assertSame( $toTitle->getPrefixedText(), $target->getPrefixedText() );
                }
 
-               $this->assertSame( $id, $toTitle->getArticleId() );
+               $this->assertSame( $id, $toTitle->getArticleID() );
        }
 
        /**
@@ -126,7 +126,7 @@ class ApiMoveTest extends ApiTestCase {
                                'to' => '[',
                        ] );
                } finally {
-                       $this->assertSame( $id, Title::newFromText( $name )->getArticleId() );
+                       $this->assertSame( $id, Title::newFromText( $name )->getArticleID() );
                }
        }
 
@@ -161,7 +161,7 @@ class ApiMoveTest extends ApiTestCase {
                                'to' => "$name 3",
                        ] );
                } finally {
-                       $this->assertSame( $id, Title::newFromText( "$name 2" )->getArticleId() );
+                       $this->assertSame( $id, Title::newFromText( "$name 2" )->getArticleID() );
                        $this->assertFalse( Title::newFromText( "$name 3" )->exists(),
                                "\"$name 3\" should not exist" );
                }
@@ -187,7 +187,7 @@ class ApiMoveTest extends ApiTestCase {
                                'tags' => 'custom tag',
                        ] );
                } finally {
-                       $this->assertSame( $id, Title::newFromText( $name )->getArticleId() );
+                       $this->assertSame( $id, Title::newFromText( $name )->getArticleID() );
                        $this->assertFalse( Title::newFromText( "$name 2" )->exists(),
                                "\"$name 2\" should not exist" );
                }
@@ -241,9 +241,9 @@ class ApiMoveTest extends ApiTestCase {
                ] );
 
                $this->assertMoved( $name, "$name 2", $id );
-               $this->assertSame( $talkId, Title::newFromText( "Talk:$name" )->getArticleId() );
+               $this->assertSame( $talkId, Title::newFromText( "Talk:$name" )->getArticleID() );
                $this->assertSame( $talkDestinationId,
-                       Title::newFromText( "Talk:$name 2" )->getArticleId() );
+                       Title::newFromText( "Talk:$name 2" )->getArticleID() );
                $this->assertSame( [ [
                        'message' => 'articleexists',
                        'params' => [],
@@ -278,9 +278,9 @@ class ApiMoveTest extends ApiTestCase {
                }
 
                $this->assertSame( $ids["$name/error"],
-                       Title::newFromText( "$name/error" )->getArticleId() );
+                       Title::newFromText( "$name/error" )->getArticleID() );
                $this->assertSame( $ids["$name 2/error"],
-                       Title::newFromText( "$name 2/error" )->getArticleId() );
+                       Title::newFromText( "$name 2/error" )->getArticleID() );
 
                $results = array_merge( $res[0]['move']['subpages'], $res[0]['move']['subpages-talk'] );
                foreach ( $results as $arr ) {
@@ -317,7 +317,7 @@ class ApiMoveTest extends ApiTestCase {
                                'to' => "$name 2",
                        ], null, $user );
                } finally {
-                       $this->assertSame( $id, Title::newFromText( "$name" )->getArticleId() );
+                       $this->assertSame( $id, Title::newFromText( "$name" )->getArticleID() );
                        $this->assertFalse( Title::newFromText( "$name 2" )->exists(),
                                "\"$name 2\" should not exist" );
                }
@@ -372,7 +372,7 @@ class ApiMoveTest extends ApiTestCase {
                ] );
 
                $this->assertMoved( "Talk:$name", $name, $idBase );
-               $this->assertSame( $idSub, Title::newFromText( "Talk:$name/1" )->getArticleId() );
+               $this->assertSame( $idSub, Title::newFromText( "Talk:$name/1" )->getArticleID() );
                $this->assertFalse( Title::newFromText( "$name/1" )->exists(),
                        "\"$name/1\" should not exist" );
 
index 95cb3b7..dc7678d 100644 (file)
@@ -38,7 +38,7 @@ class PageRestrictionTest extends RestrictionTestCase {
 
                $restriction = new $class( 1, 1 );
                $title = \Title::newFromId( 1 );
-               $this->assertEquals( $title->getArticleId(), $restriction->getTitle()->getArticleId() );
+               $this->assertEquals( $title->getArticleID(), $restriction->getTitle()->getArticleID() );
        }
 
        public function testNewFromRow() {
index 570291c..7d37881 100644 (file)
@@ -245,7 +245,7 @@ class BlockListPagerTest extends MediaWikiTestCase {
 
                $restriction = $restrictions[0];
                $this->assertEquals( $page->getId(), $restriction->getValue() );
-               $this->assertEquals( $page->getId(), $restriction->getTitle()->getArticleId() );
+               $this->assertEquals( $page->getId(), $restriction->getTitle()->getArticleID() );
                $this->assertEquals( $title->getDBKey(), $restriction->getTitle()->getDBKey() );
                $this->assertEquals( $title->getNamespace(), $restriction->getTitle()->getNamespace() );