From 1834ee3d8e2f6a8ef2067ee7925c4f561209b12f Mon Sep 17 00:00:00 2001 From: Reedy Date: Fri, 18 Mar 2016 13:55:54 +0000 Subject: [PATCH] Fix numerous class/function casing Change-Id: I23982bfa0548c9ea3bdb432be7982f1563930715 --- includes/db/DatabaseMysqli.php | 2 +- includes/htmlform/HTMLTitleTextField.php | 2 +- includes/htmlform/HTMLUserTextField.php | 2 +- includes/import/WikiImporter.php | 2 +- includes/installer/WebInstallerComplete.php | 4 ++-- includes/installer/WebInstallerInstall.php | 4 ++-- includes/installer/WebInstallerName.php | 4 ++-- includes/installer/WebInstallerOptions.php | 6 +++--- includes/jobqueue/utils/BacklinkJobUtils.php | 2 +- includes/media/Bitmap_ClientOnly.php | 2 +- includes/pager/ReverseChronologicalPager.php | 2 +- includes/parser/ParserCache.php | 4 ++-- includes/specials/SpecialContributions.php | 2 +- includes/specials/SpecialFileDuplicateSearch.php | 2 +- includes/specials/SpecialListDuplicatedFiles.php | 4 ++-- includes/specials/SpecialRecentchangeslinked.php | 2 +- includes/specials/SpecialRedirect.php | 4 ++-- maintenance/cleanupUploadStash.php | 2 +- maintenance/parse.php | 2 +- maintenance/updateSearchIndex.php | 2 +- tests/phpunit/includes/BlockTest.php | 4 ++-- tests/phpunit/includes/FauxResponseTest.php | 10 +++++----- tests/phpunit/includes/RevisionStorageTest.php | 2 +- tests/phpunit/includes/TitlePermissionTest.php | 4 ++-- tests/phpunit/includes/api/ApiLoginTest.php | 4 ++-- tests/phpunit/includes/api/UserWrapper.php | 2 +- tests/phpunit/includes/cache/GenderCacheTest.php | 6 +++--- tests/phpunit/includes/context/RequestContextTest.php | 2 +- tests/phpunit/includes/exception/HttpErrorTest.php | 2 +- tests/phpunit/includes/filebackend/FileBackendTest.php | 2 +- tests/phpunit/includes/filerepo/file/LocalFileTest.php | 2 +- .../phpunit/includes/media/MediaWikiMediaTestCase.php | 2 +- .../includes/password/PasswordPolicyChecksTest.php | 8 ++++---- .../includes/password/UserPasswordPolicyTest.php | 2 +- tests/phpunit/includes/session/SessionManagerTest.php | 2 +- tests/phpunit/includes/user/LocalIdLookupTest.php | 4 ++-- tests/phpunit/maintenance/backupTextPassTest.php | 2 +- tests/phpunit/maintenance/backup_PageTest.php | 2 +- tests/phpunit/skins/SideBarTest.php | 4 ++-- tests/phpunit/structure/ApiDocumentationTest.php | 2 +- tests/phpunit/suites/UploadFromUrlTestSuite.php | 2 +- 41 files changed, 63 insertions(+), 63 deletions(-) diff --git a/includes/db/DatabaseMysqli.php b/includes/db/DatabaseMysqli.php index 8ca2362773..d45805ad46 100644 --- a/includes/db/DatabaseMysqli.php +++ b/includes/db/DatabaseMysqli.php @@ -322,7 +322,7 @@ class DatabaseMysqli extends DatabaseMysqlBase { * @return string */ public function __toString() { - if ( $this->mConn instanceof Mysqli ) { + if ( $this->mConn instanceof mysqli ) { return (string)$this->mConn->thread_id; } else { // mConn might be false or something. diff --git a/includes/htmlform/HTMLTitleTextField.php b/includes/htmlform/HTMLTitleTextField.php index 410d15d080..fcf721a57b 100644 --- a/includes/htmlform/HTMLTitleTextField.php +++ b/includes/htmlform/HTMLTitleTextField.php @@ -86,7 +86,7 @@ class HTMLTitleTextField extends HTMLTextField { $this->mClass .= 'mw-searchInput'; // return the HTMLTextField html - return parent::getInputHtml( $value ); + return parent::getInputHTML( $value ); } protected function getDataAttribs() { diff --git a/includes/htmlform/HTMLUserTextField.php b/includes/htmlform/HTMLUserTextField.php index 92b35a8331..5a7e0b9b85 100644 --- a/includes/htmlform/HTMLUserTextField.php +++ b/includes/htmlform/HTMLUserTextField.php @@ -51,6 +51,6 @@ class HTMLUserTextField extends HTMLTextField { $this->mClass .= ' mw-autocomplete-user'; // return parent html - return parent::getInputHtml( $value ); + return parent::getInputHTML( $value ); } } diff --git a/includes/import/WikiImporter.php b/includes/import/WikiImporter.php index b6740d2a83..98ae34f147 100644 --- a/includes/import/WikiImporter.php +++ b/includes/import/WikiImporter.php @@ -604,7 +604,7 @@ class WikiImporter { $normalFields = [ 'sitename', 'base', 'generator', 'case' ]; while ( $this->reader->read() ) { - if ( $this->reader->nodeType == XmlReader::END_ELEMENT && + if ( $this->reader->nodeType == XMLReader::END_ELEMENT && $this->reader->localName == 'siteinfo' ) { break; } diff --git a/includes/installer/WebInstallerComplete.php b/includes/installer/WebInstallerComplete.php index ffab9bb2e7..11a183314a 100644 --- a/includes/installer/WebInstallerComplete.php +++ b/includes/installer/WebInstallerComplete.php @@ -24,12 +24,12 @@ class WebInstallerComplete extends WebInstallerPage { public function execute() { // Pop up a dialog box, to make it difficult for the user to forget // to download the file - $lsUrl = $this->getVar( 'wgServer' ) . $this->parent->getURL( [ 'localsettings' => 1 ] ); + $lsUrl = $this->getVar( 'wgServer' ) . $this->parent->getUrl( [ 'localsettings' => 1 ] ); if ( isset( $_SERVER['HTTP_USER_AGENT'] ) && strpos( $_SERVER['HTTP_USER_AGENT'], 'MSIE' ) !== false ) { // JS appears to be the only method that works consistently with IE7+ - $this->addHtml( "\n\n" ); } else { $this->parent->request->response()->header( "Refresh: 0;url=$lsUrl" ); diff --git a/includes/installer/WebInstallerInstall.php b/includes/installer/WebInstallerInstall.php index 9d0d680cfd..63740e3824 100644 --- a/includes/installer/WebInstallerInstall.php +++ b/includes/installer/WebInstallerInstall.php @@ -81,9 +81,9 @@ class WebInstallerInstall extends WebInstallerPage { if ( $step == 'extension-tables' ) { $this->endLiveBox(); } - $msg = $status->isOk() ? 'config-install-step-done' : 'config-install-step-failed'; + $msg = $status->isOK() ? 'config-install-step-done' : 'config-install-step-failed'; $html = wfMessage( 'word-separator' )->escaped() . wfMessage( $msg )->escaped(); - if ( !$status->isOk() ) { + if ( !$status->isOK() ) { $html = "$html"; } $this->addHTML( $html . "\n" ); diff --git a/includes/installer/WebInstallerName.php b/includes/installer/WebInstallerName.php index 556461828d..dcd30cf2bc 100644 --- a/includes/installer/WebInstallerName.php +++ b/includes/installer/WebInstallerName.php @@ -73,7 +73,7 @@ class WebInstallerName extends WebInstallerPage { 'label' => '', // @todo Needs a label? 'attribs' => [ 'readonly' => 'readonly', 'class' => 'enabledByOther' ] ] ) . - $this->getFieldSetStart( 'config-admin-box' ) . + $this->getFieldsetStart( 'config-admin-box' ) . $this->parent->getTextBox( [ 'var' => '_AdminName', 'label' => 'config-admin-name', @@ -100,7 +100,7 @@ class WebInstallerName extends WebInstallerPage { 'label' => 'config-subscribe', 'help' => $this->parent->getHelpBox( 'config-subscribe-help' ) ] ) . - $this->getFieldSetEnd() . + $this->getFieldsetEnd() . $this->parent->getInfoBox( wfMessage( 'config-almost-done' )->text() ) . // getRadioSet() builds a set of labeled radio buttons. // For grep: The following messages are used as the item labels: diff --git a/includes/installer/WebInstallerOptions.php b/includes/installer/WebInstallerOptions.php index 7cc5db23bd..938f77530f 100644 --- a/includes/installer/WebInstallerOptions.php +++ b/includes/installer/WebInstallerOptions.php @@ -67,7 +67,7 @@ class WebInstallerOptions extends WebInstallerPage { $this->parent->getHelpBox( 'config-license-help' ) . # E-mail - $this->getFieldSetStart( 'config-email-settings' ) . + $this->getFieldsetStart( 'config-email-settings' ) . $this->parent->getCheckBox( [ 'var' => 'wgEnableEmail', 'label' => 'config-enable-email', @@ -101,11 +101,11 @@ class WebInstallerOptions extends WebInstallerPage { ] ) . $this->parent->getHelpBox( 'config-email-auth-help' ) . "" . - $this->getFieldSetEnd() + $this->getFieldsetEnd() ); $skins = $this->parent->findExtensions( 'skins' ); - $skinHtml = $this->getFieldSetStart( 'config-skins' ); + $skinHtml = $this->getFieldsetStart( 'config-skins' ); $skinNames = array_map( 'strtolower', $skins ); $chosenSkinName = $this->getVar( 'wgDefaultSkin', $this->parent->getDefaultSkin( $skinNames ) ); diff --git a/includes/jobqueue/utils/BacklinkJobUtils.php b/includes/jobqueue/utils/BacklinkJobUtils.php index a81cadefc6..7f500554bd 100644 --- a/includes/jobqueue/utils/BacklinkJobUtils.php +++ b/includes/jobqueue/utils/BacklinkJobUtils.php @@ -116,7 +116,7 @@ class BacklinkJobUtils { foreach ( array_chunk( $titles, $cSize ) as $titleBatch ) { $pages = []; foreach ( $titleBatch as $tl ) { - $pages[$tl->getArticleId()] = [ $tl->getNamespace(), $tl->getDBKey() ]; + $pages[$tl->getArticleID()] = [ $tl->getNamespace(), $tl->getDBkey() ]; } $jobs[] = new $class( $title, // maintain parent job title diff --git a/includes/media/Bitmap_ClientOnly.php b/includes/media/Bitmap_ClientOnly.php index b91fb8aa67..56b20acba5 100644 --- a/includes/media/Bitmap_ClientOnly.php +++ b/includes/media/Bitmap_ClientOnly.php @@ -55,6 +55,6 @@ class BitmapHandler_ClientOnly extends BitmapHandler { return new TransformParameterError( $params ); } - return new ThumbnailImage( $image, $image->getURL(), $image->getLocalRefPath(), $params ); + return new ThumbnailImage( $image, $image->getUrl(), $image->getLocalRefPath(), $params ); } } diff --git a/includes/pager/ReverseChronologicalPager.php b/includes/pager/ReverseChronologicalPager.php index 2c415d6843..31c9c6dcec 100644 --- a/includes/pager/ReverseChronologicalPager.php +++ b/includes/pager/ReverseChronologicalPager.php @@ -115,7 +115,7 @@ abstract class ReverseChronologicalPager extends IndexPager { // Treat the given time in the wiki timezone and get a UTC timestamp for the database lookup $timestamp = MWTimestamp::getInstance( "${ymd}000000" ); - $timestamp->setTimeZone( $this->getConfig()->get( 'Localtimezone' ) ); + $timestamp->setTimezone( $this->getConfig()->get( 'Localtimezone' ) ); $this->mOffset = $this->mDb->timestamp( $timestamp->getTimestamp() ); } diff --git a/includes/parser/ParserCache.php b/includes/parser/ParserCache.php index bd5afaf033..916cfc26a1 100644 --- a/includes/parser/ParserCache.php +++ b/includes/parser/ParserCache.php @@ -64,7 +64,7 @@ class ParserCache { global $wgRequest; // idhash seem to mean 'page id' + 'rendering hash' (r3710) - $pageid = $article->getID(); + $pageid = $article->getId(); $renderkey = (int)( $wgRequest->getVal( 'action' ) == 'render' ); $key = wfMemcKey( 'pcache', 'idhash', "{$pageid}-{$renderkey}!{$hash}" ); @@ -76,7 +76,7 @@ class ParserCache { * @return mixed|string */ protected function getOptionsKey( $article ) { - $pageid = $article->getID(); + $pageid = $article->getId(); return wfMemcKey( 'pcache', 'idoptions', "{$pageid}" ); } diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index 5a351a7967..7b8aa4c5f8 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -85,7 +85,7 @@ class SpecialContributions extends IncludableSpecialPage { return; } - $id = $userObj->getID(); + $id = $userObj->getId(); if ( $this->opts['contribs'] != 'newbie' ) { $target = $nt->getText(); diff --git a/includes/specials/SpecialFileDuplicateSearch.php b/includes/specials/SpecialFileDuplicateSearch.php index 35861e3dfb..7f3eff7317 100644 --- a/includes/specials/SpecialFileDuplicateSearch.php +++ b/includes/specials/SpecialFileDuplicateSearch.php @@ -79,7 +79,7 @@ class FileDuplicateSearchPage extends QueryPage { } $html[] = $this->closeList(); - $this->getOutput()->addHtml( implode( "\n", $html ) ); + $this->getOutput()->addHTML( implode( "\n", $html ) ); } public function getQueryInfo() { diff --git a/includes/specials/SpecialListDuplicatedFiles.php b/includes/specials/SpecialListDuplicatedFiles.php index ed7e9549d5..49fa417c0e 100644 --- a/includes/specials/SpecialListDuplicatedFiles.php +++ b/includes/specials/SpecialListDuplicatedFiles.php @@ -96,12 +96,12 @@ class ListDuplicatedFilesPage extends QueryPage { // Future version might include a list of the first 5 duplicates // perhaps separated by an "↔". $image1 = Title::makeTitle( $result->namespace, $result->title ); - $dupeSearch = SpecialPage::getTitleFor( 'FileDuplicateSearch', $image1->getDBKey() ); + $dupeSearch = SpecialPage::getTitleFor( 'FileDuplicateSearch', $image1->getDBkey() ); $msg = $this->msg( 'listduplicatedfiles-entry' ) ->params( $image1->getText() ) ->numParams( $result->value - 1 ) - ->params( $dupeSearch->getPrefixedDBKey() ); + ->params( $dupeSearch->getPrefixedDBkey() ); return $msg->parse(); } diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index a259ac2008..57a3d929ad 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -57,7 +57,7 @@ class SpecialRecentChangesLinked extends SpecialRecentChanges { $outputPage = $this->getOutput(); $title = Title::newFromText( $target ); if ( !$title || $title->isExternal() ) { - $outputPage->addHtml( '
' . $this->msg( 'allpagesbadtitle' ) + $outputPage->addHTML( '
' . $this->msg( 'allpagesbadtitle' ) ->parse() . '
' ); return false; diff --git a/includes/specials/SpecialRedirect.php b/includes/specials/SpecialRedirect.php index 206e400662..c0ed4c9943 100644 --- a/includes/specials/SpecialRedirect.php +++ b/includes/specials/SpecialRedirect.php @@ -99,7 +99,7 @@ class SpecialRedirect extends FormSpecialPage { return null; } // Default behavior: Use the direct link to the file. - $url = $file->getURL(); + $url = $file->getUrl(); $request = $this->getRequest(); $width = $request->getInt( 'width', -1 ); $height = $request->getInt( 'height', -1 ); @@ -110,7 +110,7 @@ class SpecialRedirect extends FormSpecialPage { // ... and we can if ( $mto && !$mto->isError() ) { // ... change the URL to point to a thumbnail. - $url = $mto->getURL(); + $url = $mto->getUrl(); } } diff --git a/maintenance/cleanupUploadStash.php b/maintenance/cleanupUploadStash.php index 559dbd607d..cd7a8420f9 100644 --- a/maintenance/cleanupUploadStash.php +++ b/maintenance/cleanupUploadStash.php @@ -47,7 +47,7 @@ class UploadStashCleanup extends Maintenance { $repo = RepoGroup::singleton()->getLocalRepo(); $tempRepo = $repo->getTempRepo(); - $dbr = $repo->getSlaveDb(); + $dbr = $repo->getSlaveDB(); // how far back should this look for files to delete? $cutoff = time() - $wgUploadStashMaxAge; diff --git a/maintenance/parse.php b/maintenance/parse.php index effed56dcd..17a8d2ebf4 100644 --- a/maintenance/parse.php +++ b/maintenance/parse.php @@ -73,7 +73,7 @@ class CLIParser extends Maintenance { public function execute() { $this->initParser(); - print $this->render( $this->WikiText() ); + print $this->render( $this->Wikitext() ); } /** diff --git a/maintenance/updateSearchIndex.php b/maintenance/updateSearchIndex.php index 8a895f2709..cdb7d9f701 100644 --- a/maintenance/updateSearchIndex.php +++ b/maintenance/updateSearchIndex.php @@ -61,7 +61,7 @@ class UpdateSearchIndex extends Maintenance { } public function execute() { - $posFile = $this->getOption( 'p', 'searchUpdate.' . wfWikiId() . '.pos' ); + $posFile = $this->getOption( 'p', 'searchUpdate.' . wfWikiID() . '.pos' ); $end = $this->getOption( 'e', wfTimestampNow() ); if ( $this->hasOption( 's' ) ) { $start = $this->getOption( 's' ); diff --git a/tests/phpunit/includes/BlockTest.php b/tests/phpunit/includes/BlockTest.php index 35ebf42c26..f8d2003f11 100644 --- a/tests/phpunit/includes/BlockTest.php +++ b/tests/phpunit/includes/BlockTest.php @@ -15,7 +15,7 @@ class BlockTest extends MediaWikiLangTestCase { function addDBData() { $user = User::newFromName( 'UTBlockee' ); - if ( $user->getID() == 0 ) { + if ( $user->getId() == 0 ) { $user->addToDatabase(); TestUser::setPasswordForUser( $user, 'UTBlockeePassword' ); @@ -31,7 +31,7 @@ class BlockTest extends MediaWikiLangTestCase { $blockOptions = [ 'address' => 'UTBlockee', - 'user' => $user->getID(), + 'user' => $user->getId(), 'reason' => 'Parce que', 'expiry' => time() + 100500, ]; diff --git a/tests/phpunit/includes/FauxResponseTest.php b/tests/phpunit/includes/FauxResponseTest.php index 85ac4ce0bc..eac56fb841 100644 --- a/tests/phpunit/includes/FauxResponseTest.php +++ b/tests/phpunit/includes/FauxResponseTest.php @@ -69,33 +69,33 @@ class FauxResponseTest extends MediaWikiTestCase { * @covers FauxResponse::header */ public function testHeader() { - $this->assertEquals( null, $this->response->getheader( 'Location' ), 'Non-existing header' ); + $this->assertEquals( null, $this->response->getHeader( 'Location' ), 'Non-existing header' ); $this->response->header( 'Location: http://localhost/' ); $this->assertEquals( 'http://localhost/', - $this->response->getheader( 'Location' ), + $this->response->getHeader( 'Location' ), 'Set header' ); $this->response->header( 'Location: http://127.0.0.1/' ); $this->assertEquals( 'http://127.0.0.1/', - $this->response->getheader( 'Location' ), + $this->response->getHeader( 'Location' ), 'Same header' ); $this->response->header( 'Location: http://127.0.0.2/', false ); $this->assertEquals( 'http://127.0.0.1/', - $this->response->getheader( 'Location' ), + $this->response->getHeader( 'Location' ), 'Same header with override disabled' ); $this->response->header( 'Location: http://localhost/' ); $this->assertEquals( 'http://localhost/', - $this->response->getheader( 'LOCATION' ), + $this->response->getHeader( 'LOCATION' ), 'Get header case insensitive' ); } diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index 440495b216..42b9beead6 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -95,7 +95,7 @@ class RevisionStorageTest extends MediaWikiTestCase { $rev = new Revision( $props ); - $dbw = wfgetDB( DB_MASTER ); + $dbw = wfGetDB( DB_MASTER ); $rev->insertOn( $dbw ); return $rev; diff --git a/tests/phpunit/includes/TitlePermissionTest.php b/tests/phpunit/includes/TitlePermissionTest.php index 584a368b36..6048ca7849 100644 --- a/tests/phpunit/includes/TitlePermissionTest.php +++ b/tests/phpunit/includes/TitlePermissionTest.php @@ -48,7 +48,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { if ( !isset( $this->userUser ) || !( $this->userUser instanceof User ) ) { $this->userUser = User::newFromName( $this->userName ); - if ( !$this->userUser->getID() ) { + if ( !$this->userUser->getId() ) { $this->userUser = User::createNew( $this->userName, [ "email" => "test@example.com", "real_name" => "Test User" ] ); @@ -56,7 +56,7 @@ class TitlePermissionTest extends MediaWikiLangTestCase { } $this->altUser = User::newFromName( $this->altUserName ); - if ( !$this->altUser->getID() ) { + if ( !$this->altUser->getId() ) { $this->altUser = User::createNew( $this->altUserName, [ "email" => "alttest@example.com", "real_name" => "Test User Alt" ] ); diff --git a/tests/phpunit/includes/api/ApiLoginTest.php b/tests/phpunit/includes/api/ApiLoginTest.php index 00701db8b2..46a3cf4f64 100644 --- a/tests/phpunit/includes/api/ApiLoginTest.php +++ b/tests/phpunit/includes/api/ApiLoginTest.php @@ -27,7 +27,7 @@ class ApiLoginTest extends ApiTestCase { global $wgServer; $user = self::$users['sysop']; - $user->getUser()->logOut(); + $user->getUser()->logout(); if ( !isset( $wgServer ) ) { $this->markTestIncomplete( 'This test needs $wgServer to be set in LocalSettings.php' ); @@ -72,7 +72,7 @@ class ApiLoginTest extends ApiTestCase { } $user = self::$users['sysop']; - $user->getUser()->logOut(); + $user->getUser()->logout(); $ret = $this->doApiRequest( [ "action" => "login", diff --git a/tests/phpunit/includes/api/UserWrapper.php b/tests/phpunit/includes/api/UserWrapper.php index 1f4e26c834..9942a0f2d4 100644 --- a/tests/phpunit/includes/api/UserWrapper.php +++ b/tests/phpunit/includes/api/UserWrapper.php @@ -10,7 +10,7 @@ class UserWrapper { $this->password = $password; $this->user = User::newFromName( $this->userName ); - if ( !$this->user->getID() ) { + if ( !$this->user->getId() ) { $this->user = User::createNew( $this->userName, [ "email" => "test@example.com", "real_name" => "Test User" ] ); diff --git a/tests/phpunit/includes/cache/GenderCacheTest.php b/tests/phpunit/includes/cache/GenderCacheTest.php index 40994da037..e329f8d8c5 100644 --- a/tests/phpunit/includes/cache/GenderCacheTest.php +++ b/tests/phpunit/includes/cache/GenderCacheTest.php @@ -11,7 +11,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $this->mergeMwGlobalArrayValue( 'wgDefaultUserOptions', [ 'gender' => 'unknown' ] ); $user = User::newFromName( 'UTMale' ); - if ( $user->getID() == 0 ) { + if ( $user->getId() == 0 ) { $user->addToDatabase(); TestUser::setPasswordForUser( $user, 'UTMalePassword' ); } @@ -20,7 +20,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $user->saveSettings(); $user = User::newFromName( 'UTFemale' ); - if ( $user->getID() == 0 ) { + if ( $user->getId() == 0 ) { $user->addToDatabase(); TestUser::setPasswordForUser( $user, 'UTFemalePassword' ); } @@ -29,7 +29,7 @@ class GenderCacheTest extends MediaWikiLangTestCase { $user->saveSettings(); $user = User::newFromName( 'UTDefaultGender' ); - if ( $user->getID() == 0 ) { + if ( $user->getId() == 0 ) { $user->addToDatabase(); TestUser::setPasswordForUser( $user, 'UTDefaultGenderPassword' ); } diff --git a/tests/phpunit/includes/context/RequestContextTest.php b/tests/phpunit/includes/context/RequestContextTest.php index c7fba502f8..32e71e055c 100644 --- a/tests/phpunit/includes/context/RequestContextTest.php +++ b/tests/phpunit/includes/context/RequestContextTest.php @@ -91,7 +91,7 @@ class RequestContextTest extends MediaWikiTestCase { MediaWiki\Session\SessionManager::getGlobalSession()->getId(), "Correct context session ID." ); - if ( \MediaWiki\Session\PhpSessionHandler::isEnabled() ) { + if ( \MediaWiki\Session\PHPSessionHandler::isEnabled() ) { $this->assertEquals( $sinfo['sessionId'], session_id(), "Correct context session ID." ); } else { $this->assertEquals( $oldSessionId, session_id(), "Unchanged PHP session ID." ); diff --git a/tests/phpunit/includes/exception/HttpErrorTest.php b/tests/phpunit/includes/exception/HttpErrorTest.php index e7f3a2108e..90ccd1e551 100644 --- a/tests/phpunit/includes/exception/HttpErrorTest.php +++ b/tests/phpunit/includes/exception/HttpErrorTest.php @@ -22,7 +22,7 @@ class HttpErrorTest extends MediaWikiTestCase { */ public function testGetHtml( array $expected, $content, $header ) { $httpError = new HttpError( 500, $content, $header ); - $errorHtml = $httpError->getHtml(); + $errorHtml = $httpError->getHTML(); foreach ( $expected as $key => $html ) { $this->assertContains( $html, $errorHtml, $key ); diff --git a/tests/phpunit/includes/filebackend/FileBackendTest.php b/tests/phpunit/includes/filebackend/FileBackendTest.php index bf59ab5034..f259c0f171 100644 --- a/tests/phpunit/includes/filebackend/FileBackendTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendTest.php @@ -57,7 +57,7 @@ class FileBackendTest extends MediaWikiTestCase { 'name' => 'localtesting', 'lockManager' => LockManagerGroup::singleton()->get( 'fsLockManager' ), 'parallelize' => 'implicit', - 'wikiId' => wfWikiId() . wfRandomString(), + 'wikiId' => wfWikiID() . wfRandomString(), 'backends' => [ [ 'name' => 'localmultitesting1', diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php index 9c7040ace4..ffaa2c32bf 100644 --- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php +++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php @@ -20,7 +20,7 @@ class LocalFileTest extends MediaWikiTestCase { 'transformVia404' => false, 'backend' => new FSFileBackend( [ 'name' => 'local-backend', - 'wikiId' => wfWikiId(), + 'wikiId' => wfWikiID(), 'containerPaths' => [ 'cont1' => "/testdir/local-backend/tempimages/cont1", 'cont2' => "/testdir/local-backend/tempimages/cont2" diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 5887d38997..5042121ccc 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -25,7 +25,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiTestCase { $this->backend = new FSFileBackend( [ 'name' => 'localtesting', - 'wikiId' => wfWikiId(), + 'wikiId' => wfWikiID(), 'containerPaths' => $containers ] ); $this->repo = new FSRepo( $this->getRepoOptions() ); diff --git a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php index af34282fb3..e28614e891 100644 --- a/tests/phpunit/includes/password/PasswordPolicyChecksTest.php +++ b/tests/phpunit/includes/password/PasswordPolicyChecksTest.php @@ -42,7 +42,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { 'Password is shorter than minimal policy' ); $this->assertTrue( - $statusShort->isOk(), + $statusShort->isOK(), 'Password is shorter than minimal policy, not fatal' ); } @@ -67,7 +67,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { 'Password is shorter than minimum login policy' ); $this->assertFalse( - $statusShort->isOk(), + $statusShort->isOK(), 'Password is shorter than minimum login policy, fatal' ); } @@ -90,7 +90,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { $this->assertFalse( $statusLong->isGood(), 'Password is longer than maximal policy' ); - $this->assertFalse( $statusLong->isOk(), + $this->assertFalse( $statusLong->isOK(), 'Password is longer than maximal policy, fatal' ); } @@ -111,7 +111,7 @@ class PasswordPolicyChecksTest extends MediaWikiTestCase { 'user' // password ); $this->assertFalse( $statusLong->isGood(), 'Password matches username' ); - $this->assertTrue( $statusLong->isOk(), 'Password matches username, not fatal' ); + $this->assertTrue( $statusLong->isOK(), 'Password matches username, not fatal' ); } /** diff --git a/tests/phpunit/includes/password/UserPasswordPolicyTest.php b/tests/phpunit/includes/password/UserPasswordPolicyTest.php index d820040b74..d16200beb6 100644 --- a/tests/phpunit/includes/password/UserPasswordPolicyTest.php +++ b/tests/phpunit/includes/password/UserPasswordPolicyTest.php @@ -112,7 +112,7 @@ class UserPasswordPolicyTest extends MediaWikiTestCase { $status = $upp->checkUserPassword( $user, $password ); $this->assertSame( $valid, $status->isGood(), $msg . ' - password valid' ); - $this->assertSame( $ok, $status->isOk(), $msg . ' - can login' ); + $this->assertSame( $ok, $status->isOK(), $msg . ' - can login' ); } public function provideCheckUserPassword() { diff --git a/tests/phpunit/includes/session/SessionManagerTest.php b/tests/phpunit/includes/session/SessionManagerTest.php index a1b9bb44ea..cd3177cf6b 100644 --- a/tests/phpunit/includes/session/SessionManagerTest.php +++ b/tests/phpunit/includes/session/SessionManagerTest.php @@ -251,7 +251,7 @@ class SessionManagerTest extends MediaWikiTestCase { try { $manager->getSessionForRequest( $request ); $this->fail( 'Expcected exception not thrown' ); - } catch ( \OverFlowException $ex ) { + } catch ( \OverflowException $ex ) { $this->assertStringStartsWith( 'Multiple sessions for this request tied for top priority: ', $ex->getMessage() diff --git a/tests/phpunit/includes/user/LocalIdLookupTest.php b/tests/phpunit/includes/user/LocalIdLookupTest.php index e2b138b67a..c86fb6cff3 100644 --- a/tests/phpunit/includes/user/LocalIdLookupTest.php +++ b/tests/phpunit/includes/user/LocalIdLookupTest.php @@ -104,11 +104,11 @@ class LocalIdLookupTest extends MediaWikiTestCase { $this->assertTrue( $lookup->isAttached( $user1 ) ); $this->assertFalse( $lookup->isAttached( $user2 ) ); - $wiki = wfWikiId(); + $wiki = wfWikiID(); $this->assertTrue( $lookup->isAttached( $user1, $wiki ) ); $this->assertFalse( $lookup->isAttached( $user2, $wiki ) ); - $wiki = 'not-' . wfWikiId(); + $wiki = 'not-' . wfWikiID(); $this->assertFalse( $lookup->isAttached( $user1, $wiki ) ); $this->assertFalse( $lookup->isAttached( $user2, $wiki ) ); } diff --git a/tests/phpunit/maintenance/backupTextPassTest.php b/tests/phpunit/maintenance/backupTextPassTest.php index e0152165ae..69a5a7e198 100644 --- a/tests/phpunit/maintenance/backupTextPassTest.php +++ b/tests/phpunit/maintenance/backupTextPassTest.php @@ -114,7 +114,7 @@ class TextPassDumperDatabaseTest extends DumpTestCase { $dumper = new TextPassDumper( [ "--stub=file:" . $nameStub, "--output=file:" . $nameFull ] ); $dumper->reporting = false; - $dumper->setDb( $this->db ); + $dumper->setDB( $this->db ); // Performing the dump $dumper->dump( WikiExporter::FULL, WikiExporter::TEXT ); diff --git a/tests/phpunit/maintenance/backup_PageTest.php b/tests/phpunit/maintenance/backup_PageTest.php index 5cd8336ee9..a07e62c9b8 100644 --- a/tests/phpunit/maintenance/backup_PageTest.php +++ b/tests/phpunit/maintenance/backup_PageTest.php @@ -104,7 +104,7 @@ class BackupDumperPageTest extends DumpTestCase { $dumper->loadWithArgv( [ '--full', '--quiet', '--output', 'file:' . $fname ] ); $dumper->startId = $this->pageId1; $dumper->endId = $this->pageId4 + 1; - $dumper->setDb( $this->db ); + $dumper->setDB( $this->db ); // Performing the dump $dumper->execute(); diff --git a/tests/phpunit/skins/SideBarTest.php b/tests/phpunit/skins/SideBarTest.php index 81e2c6560c..0945b8f55d 100644 --- a/tests/phpunit/skins/SideBarTest.php +++ b/tests/phpunit/skins/SideBarTest.php @@ -78,7 +78,7 @@ class SideBarTest extends MediaWikiLangTestCase { * @covers SkinTemplate::addToSidebarPlain */ public function testExpandMessages() { - $this->assertSidebar( + $this->assertSideBar( [ 'Title' => [ [ 'text' => 'Help', @@ -102,7 +102,7 @@ class SideBarTest extends MediaWikiLangTestCase { 'wgNoFollowDomainExceptions' => [], 'wgNoFollowNsExceptions' => [], ] ); - $this->assertSidebar( + $this->assertSideBar( [ 'Title' => [ # ** http://www.mediawiki.org/| Home [ diff --git a/tests/phpunit/structure/ApiDocumentationTest.php b/tests/phpunit/structure/ApiDocumentationTest.php index 542420a9dc..2049e38ba0 100644 --- a/tests/phpunit/structure/ApiDocumentationTest.php +++ b/tests/phpunit/structure/ApiDocumentationTest.php @@ -65,7 +65,7 @@ class ApiDocumentationTest extends MediaWikiTestCase { RequestContext::getMain()->getConfig(), ] ) ); foreach ( $globals as $k => $v ) { - $this->setMWGlobals( "wg$k", $v ); + $this->setMwGlobals( "wg$k", $v ); } // Fetch module. diff --git a/tests/phpunit/suites/UploadFromUrlTestSuite.php b/tests/phpunit/suites/UploadFromUrlTestSuite.php index e3c5118e7a..8366369579 100644 --- a/tests/phpunit/suites/UploadFromUrlTestSuite.php +++ b/tests/phpunit/suites/UploadFromUrlTestSuite.php @@ -37,7 +37,7 @@ class UploadFromUrlTestSuite extends PHPUnit_Framework_TestSuite { 'transformVia404' => false, 'backend' => new FSFileBackend( [ 'name' => 'local-backend', - 'wikiId' => wfWikiId(), + 'wikiId' => wfWikiID(), 'containerPaths' => [ 'local-public' => "{$tmpDir}/test-repo/public", 'local-thumb' => "{$tmpDir}/test-repo/thumb", -- 2.20.1