From: Thalia Date: Wed, 6 Feb 2019 22:15:05 +0000 (+0000) Subject: Ensure calls to Title::getArticleID use the same case as the definition X-Git-Tag: 1.34.0-rc.0~2915^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dmes_infos.php?a=commitdiff_plain;h=5e683829d660d897ec92e10cdecc351587dbc49f;p=lhc%2Fweb%2Fwiklou.git Ensure calls to Title::getArticleID use the same case as the definition Change-Id: Ic92f43c9e9df2782ba20aa28ad9e6d2ef7976d2e --- diff --git a/includes/specials/SpecialBlock.php b/includes/specials/SpecialBlock.php index 4321cde053..9c8882b820 100644 --- a/includes/specials/SpecialBlock.php +++ b/includes/specials/SpecialBlock.php @@ -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'] ) ); diff --git a/maintenance/populateArchiveRevId.php b/maintenance/populateArchiveRevId.php index 6eb2d6d61a..ec2eff4f91 100644 --- a/maintenance/populateArchiveRevId.php +++ b/maintenance/populateArchiveRevId.php @@ -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', diff --git a/tests/phpunit/includes/api/ApiComparePagesTest.php b/tests/phpunit/includes/api/ApiComparePagesTest.php index 7bab542005..9e18eb0985 100644 --- a/tests/phpunit/includes/api/ApiComparePagesTest.php +++ b/tests/phpunit/includes/api/ApiComparePagesTest.php @@ -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' ); diff --git a/tests/phpunit/includes/api/ApiMoveTest.php b/tests/phpunit/includes/api/ApiMoveTest.php index 3fa85394c1..1e66a7d276 100644 --- a/tests/phpunit/includes/api/ApiMoveTest.php +++ b/tests/phpunit/includes/api/ApiMoveTest.php @@ -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" ); diff --git a/tests/phpunit/includes/block/Restriction/PageRestrictionTest.php b/tests/phpunit/includes/block/Restriction/PageRestrictionTest.php index 95cb3b7b72..dc7678d406 100644 --- a/tests/phpunit/includes/block/Restriction/PageRestrictionTest.php +++ b/tests/phpunit/includes/block/Restriction/PageRestrictionTest.php @@ -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() { diff --git a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php index 570291cd6e..7d37881fc6 100644 --- a/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php +++ b/tests/phpunit/includes/specials/pagers/BlockListPagerTest.php @@ -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() );