From: jenkins-bot Date: Thu, 7 Feb 2019 01:42:09 +0000 (+0000) Subject: Merge "Rename WikiMap DB domain ID methods to reduce confusion with web domains" X-Git-Tag: 1.34.0-rc.0~2914 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=86529c91b4d32bbc8546f16e339ee2e1e525ff5c;hp=5196ac32c60bf370463135c14eed3bba0d361940;p=lhc%2Fweb%2Fwiklou.git Merge "Rename WikiMap DB domain ID methods to reduce confusion with web domains" --- diff --git a/.phpcs.xml b/.phpcs.xml index 21dbe818d1..b8e35d4e65 100644 --- a/.phpcs.xml +++ b/.phpcs.xml @@ -22,17 +22,8 @@ - + @@ -132,7 +123,6 @@ */maintenance/benchmarks/bench_Wikimedia_base_convert\.php */maintenance/benchmarks/bench_delete_truncate\.php */maintenance/benchmarks/bench_if_switch\.php - */maintenance/benchmarks/bench_strtr_str_replace\.php */maintenance/benchmarks/bench_utf8_title_check\.php */maintenance/benchmarks/bench_wfIsWindows\.php */maintenance/cleanupTable.inc @@ -233,7 +223,6 @@ */includes/HistoryBlob\.php */includes/htmlform/HTMLFormElement\.php */includes/jobqueue/aggregator/JobQueueAggregator\.php - */includes/jobqueue/JobQueue\.php */includes/libs/filebackend/FileBackendStore\.php */includes/libs/filebackend/FSFileBackend\.php */includes/libs/filebackend/SwiftFileBackend\.php diff --git a/RELEASE-NOTES-1.33 b/RELEASE-NOTES-1.33 index 0ce23808e4..69ab560501 100644 --- a/RELEASE-NOTES-1.33 +++ b/RELEASE-NOTES-1.33 @@ -53,6 +53,7 @@ production. ==== Changed external libraries ==== * Updated OOUI from v0.29.2 to v0.30.2. +* Updated OOjs Router from pre-release to v0.2.0. * Updated wikimedia/xmp-reader from 0.6.0 to 0.6.1. * Updated wikimedia/scoped-callback from 2.0.0 to 3.0.0. * Updated wikimedia/ip-set from 1.2.0 to 2.0.0. @@ -228,6 +229,8 @@ because of Phabricator reports. * (T126091) The 'ResourceLoaderTestModules' hook, which lets you declare QUnit testing code for your JavaScript modules, is deprecated. Instead, you can now use the new extension registration key 'QUnitTestModule'. +* (T213426) The jquery.throttle-debounce module has been deprecated. JavaScript + code that needs this behaviour should use OO.ui.debounce/throttle. === Other changes in 1.33 === * (T208871) The hard-coded Google search form on the database error page was diff --git a/autoload.php b/autoload.php index 22f9737d49..3b04dfc172 100644 --- a/autoload.php +++ b/autoload.php @@ -708,14 +708,14 @@ $wgAutoloadLocalClasses = [ 'JobQueueAggregator' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregator.php', 'JobQueueAggregatorNull' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregator.php', 'JobQueueAggregatorRedis' => __DIR__ . '/includes/jobqueue/aggregator/JobQueueAggregatorRedis.php', - 'JobQueueConnectionError' => __DIR__ . '/includes/jobqueue/JobQueue.php', + 'JobQueueConnectionError' => __DIR__ . '/includes/jobqueue/exception/JobQueueConnectionError.php', 'JobQueueDB' => __DIR__ . '/includes/jobqueue/JobQueueDB.php', 'JobQueueEnqueueUpdate' => __DIR__ . '/includes/deferred/JobQueueEnqueueUpdate.php', - 'JobQueueError' => __DIR__ . '/includes/jobqueue/JobQueue.php', + 'JobQueueError' => __DIR__ . '/includes/jobqueue/exception/JobQueueError.php', 'JobQueueFederated' => __DIR__ . '/includes/jobqueue/JobQueueFederated.php', 'JobQueueGroup' => __DIR__ . '/includes/jobqueue/JobQueueGroup.php', 'JobQueueMemory' => __DIR__ . '/includes/jobqueue/JobQueueMemory.php', - 'JobQueueReadOnlyError' => __DIR__ . '/includes/jobqueue/JobQueue.php', + 'JobQueueReadOnlyError' => __DIR__ . '/includes/jobqueue/exception/JobQueueReadOnlyError.php', 'JobQueueRedis' => __DIR__ . '/includes/jobqueue/JobQueueRedis.php', 'JobRunner' => __DIR__ . '/includes/jobqueue/JobRunner.php', 'JobSpecification' => __DIR__ . '/includes/jobqueue/JobSpecification.php', diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index 0ca272cfdd..660352ac79 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -724,17 +724,3 @@ abstract class JobQueue { $stats->updateCount( "jobqueue.{$key}.{$type}", $delta ); } } - -/** - * @ingroup JobQueue - * @since 1.22 - */ -class JobQueueError extends MWException { -} - -class JobQueueConnectionError extends JobQueueError { -} - -class JobQueueReadOnlyError extends JobQueueError { - -} diff --git a/includes/jobqueue/exception/JobQueueConnectionError.php b/includes/jobqueue/exception/JobQueueConnectionError.php new file mode 100644 index 0000000000..7f32f23734 --- /dev/null +++ b/includes/jobqueue/exception/JobQueueConnectionError.php @@ -0,0 +1,29 @@ +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/maintenance/resources/foreign-resources.yaml b/maintenance/resources/foreign-resources.yaml index 7760f1d133..ee74bb3988 100644 --- a/maintenance/resources/foreign-resources.yaml +++ b/maintenance/resources/foreign-resources.yaml @@ -110,6 +110,16 @@ oojs: package/LICENSE-MIT: package/README.md: +oojs-router: + type: tar + src: https://registry.npmjs.org/oojs-router/-/oojs-router-0.2.0.tgz + integrity: sha384-VngYqdQ3vTDMXbm4e4FUZCCGos7fB0Jkr9V+kBL5MElprK1h0yQZOzBNnMHtSJS/ + dest: + package/dist/oojs-router.js: + package/LICENSE: + package/AUTHORS.txt: + package/History.md: + ooui: type: tar src: https://registry.npmjs.org/oojs-ui/-/oojs-ui-0.30.2.tgz diff --git a/resources/Resources.php b/resources/Resources.php index 83f11f865e..f807228f8c 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -337,6 +337,8 @@ return [ 'targets' => [ 'mobile', 'desktop' ], ], 'jquery.throttle-debounce' => [ + 'deprecated' => 'Please use OO.ui.throttle/debounce instead. See ' + . 'https://phabricator.wikimedia.org/T213426', 'scripts' => 'resources/lib/jquery.ba-throttle-debounce.js', 'targets' => [ 'desktop', 'mobile' ], ], diff --git a/resources/lib/oojs-router/AUTHORS.txt b/resources/lib/oojs-router/AUTHORS.txt index 5390c84cb2..a406b57ac6 100644 --- a/resources/lib/oojs-router/AUTHORS.txt +++ b/resources/lib/oojs-router/AUTHORS.txt @@ -1 +1,7 @@ +Ed Sanders +James D. Forrester Jon Robson +Kunal Mehta +MarcoAurelio +Prateek Saxena +Timo Tijhof diff --git a/resources/lib/oojs-router/History.md b/resources/lib/oojs-router/History.md new file mode 100644 index 0000000000..c3889cfbe0 --- /dev/null +++ b/resources/lib/oojs-router/History.md @@ -0,0 +1,23 @@ +# OOjs Router Release History +## v0.2.0 / 2019-02-06 +* build: Misc clean up (Timo Tijhof) +* Code style fixes and refactoring (Ed Sanders) +* build: Switch to ESLint (Timo Tijhof) +* Unit tests (Jon Robson) +* Add .gitreview (Christian Aistleitner) +* Remove .arcconfig & .arclint (MarcoAurelio) +* Add jsduck config (Prateek Saxena) +* build: Update devDependencies (Ed Sanders) +* Use standard coverage reporting configuration (Kunal Mehta) +* Update eslint-config-wikimedia to 0.9.0 (Ed Sanders) +* build: Update devDependencies (Ed Sanders) +* build: Structure updates (Timo Tijhof) +* OOjs Router method to provide access to replaceState (Jon Robson) +* build: Switch from prepublish to prepare for modern npm (James D. Forrester) +* build: Bump package-lock.json for npm audit (James D. Forrester) +* build: Add AUTHORS.txt to package manifest (James D. Forrester) +* AUTHORS.txt: Add everyone from `git shortlog` (James D. Forrester) + +## v0.1.0 / 2016-05-05 +* Initial commit (Jon Robson) +* Add build, CI infrastructure (James D. Forrester) diff --git a/resources/lib/oojs-router/LICENSE b/resources/lib/oojs-router/LICENSE new file mode 100644 index 0000000000..acbe708990 --- /dev/null +++ b/resources/lib/oojs-router/LICENSE @@ -0,0 +1,20 @@ +Copyright 2011-2016 OOjs Team and other contributors. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE +LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/resources/lib/oojs-router/LICENSE-MIT b/resources/lib/oojs-router/LICENSE-MIT deleted file mode 100644 index acbe708990..0000000000 --- a/resources/lib/oojs-router/LICENSE-MIT +++ /dev/null @@ -1,20 +0,0 @@ -Copyright 2011-2016 OOjs Team and other contributors. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/resources/lib/oojs-router/oojs-router.js b/resources/lib/oojs-router/oojs-router.js index b136923e9a..111d0e8055 100644 --- a/resources/lib/oojs-router/oojs-router.js +++ b/resources/lib/oojs-router/oojs-router.js @@ -1,137 +1,173 @@ /*! - * OOjs Router v0.1.0 - * https://www.mediawiki.org/wiki/OOjs + * OOjs Router v0.2.0 + * https://www.mediawiki.org/wiki/OOjs_Router * - * Copyright 2011-2016 OOjs Team and other contributors. + * Copyright 2011-2019 OOjs Team and other contributors. * Released under the MIT license - * http://oojs-router.mit-license.org + * http://oojs.mit-license.org * - * Date: 2016-05-05T19:27:58Z + * Date: 2019-02-06T21:26:01Z */ ( function ( $ ) { 'use strict'; -/** - * Does hash match entry.path? If it does apply the - * callback for the Entry object. - * - * @method - * @private - * @ignore - * @param {string} hash string to match - * @param {Object} entry Entry object - * @return {boolean} Whether hash matches entry.path - */ -function matchRoute( hash, entry ) { - var match = hash.match( entry.path ); - if ( match ) { - entry.callback.apply( this, match.slice( 1 ) ); - return true; - } - return false; -} - /** * Provides navigation routing and location information * - * @class Router - * @mixins OO.EventEmitter + * @class OO.Router + * @extends OO.Registry */ -function Router() { - var self = this; - OO.EventEmitter.call( this ); - // use an object instead of an array for routes so that we don't - // duplicate entries that already exist - this.routes = {}; +OO.Router = function OoRouter() { + var router = this; + + // Parent constructor + OO.Router.parent.call( this ); + this.enabled = true; this.oldHash = this.getPath(); $( window ).on( 'popstate', function () { - self.emit( 'popstate' ); + router.emit( 'popstate' ); } ); $( window ).on( 'hashchange', function () { - self.emit( 'hashchange' ); + router.emit( 'hashchange' ); } ); this.on( 'hashchange', function () { - // ev.originalEvent.newURL is undefined on Android 2.x - var routeEv; + // event.originalEvent.newURL is undefined on Android 2.x + var routeEvent; - if ( self.enabled ) { - routeEv = $.Event( 'route', { - path: self.getPath() + if ( router.enabled ) { + routeEvent = $.Event( 'route', { + path: router.getPath() } ); - self.emit( 'route', routeEv ); + router.emit( 'route', routeEvent ); - if ( !routeEv.isDefaultPrevented() ) { - self.checkRoute(); + if ( !routeEvent.isDefaultPrevented() ) { + router.checkRoute(); } else { // if route was prevented, ignore the next hash change and revert the // hash to its old value - self.enabled = false; - self.navigate( self.oldHash ); + router.enabled = false; + router.navigate( router.oldHash ); } } else { - self.enabled = true; + router.enabled = true; } - self.oldHash = self.getPath(); + router.oldHash = router.getPath(); } ); -} -OO.mixinClass( Router, OO.EventEmitter ); +}; + +/* Inheritance */ + +OO.inheritClass( OO.Router, OO.Registry ); + +/* Events */ /** - * Check the current route and run appropriate callback if it matches. + * @event popstate + */ + +/** + * @event hashchange + */ + +/** + * @event route + * @param {jQuery.Event} routeEvent + */ + +/* Static Methods */ + +/** + * Determine if current browser supports this router * - * @method + * @return {boolean} The browser is supported */ -Router.prototype.checkRoute = function () { - var hash = this.getPath(); +OO.Router.static.isSupported = function () { + return 'onhashchange' in window; +}; - $.each( this.routes, function ( id, entry ) { - return !matchRoute( hash, entry ); - } ); +/* Methods */ + +/** + * Check the current route and run appropriate callback if it matches. + */ +OO.Router.prototype.checkRoute = function () { + var id, entry, match, + hash = this.getPath(); + + for ( id in this.registry ) { + entry = this.registry[ id ]; + match = hash.match( entry.path ); + if ( match ) { + entry.callback.apply( this, match.slice( 1 ) ); + return; + } + } }; /** * Bind a specific callback to a hash-based route, e.g. * * @example - * route( 'alert', function () { alert( 'something' ); } ); - * route( /hi-(.*)/, function ( name ) { alert( 'Hi ' + name ) } ); + * addRoute( 'alert', function () { alert( 'something' ); } ); + * addRoute( /hi-(.*)/, function ( name ) { alert( 'Hi ' + name ) } ); + * * Note that after defining all available routes it is up to the caller * to check the existing route via the checkRoute method. * - * @method - * @param {Object} path string or RegExp to match. + * @param {string|RegExp} path Path to match, string or regular expression * @param {Function} callback Callback to be run when hash changes to one * that matches. */ -Router.prototype.route = function ( path, callback ) { +OO.Router.prototype.addRoute = function ( path, callback ) { var entry = { path: typeof path === 'string' ? - new RegExp( '^' + path.replace( /[\\^$*+?.()|[\]{}]/g, '\\$&' ) + '$' ) - : path, + new RegExp( '^' + path.replace( /[\\^$*+?.()|[\]{}]/g, '\\$&' ) + '$' ) : + path, callback: callback }; - this.routes[ entry.path ] = entry; + this.register( entry.path.toString(), entry ); }; +/** + * @deprecated Use #addRoute + */ +OO.Router.prototype.route = OO.Router.prototype.addRoute; + /** * Navigate to a specific route. * - * @method - * @param {string} path string with a route (hash without #). + * @param {string} title of new page + * @param {Object} options + * @param {string} options.path e.g. '/path/' or '/path/#foo' + * @param {boolean} options.useReplaceState Set replaceStateState to use pushState when you want to + * avoid long history queues. */ -Router.prototype.navigate = function ( path ) { - var history = window.history; +OO.Router.prototype.navigateTo = function ( title, options ) { + if ( options.useReplaceState ) { + history.replaceState( null, title, options.path ); + } else { + history.pushState( null, title, options.path ); + } +}; + +/** + * Navigate to a specific ''hash fragment'' route. + * + * @param {string} path String with a route (hash without #). + * @deprecated use navigateTo instead + */ +OO.Router.prototype.navigate = function ( path ) { // Take advantage of `pushState` when available, to clear the hash and // not leave `#` in the history. An entry with `#` in the history has // the side-effect of resetting the scroll position when navigating the // history. - if ( path === '' && history && history.pushState ) { + if ( path === '' ) { // To clear the hash we need to cut the hash from the URL. path = window.location.href.replace( /#.*$/, '' ); history.pushState( null, document.title, path ); @@ -141,30 +177,22 @@ Router.prototype.navigate = function ( path ) { } }; -/** - * Triggers back on the window - */ -Router.prototype.goBack = function () { - window.history.back(); -}; - /** * Navigate to the previous route. This is a wrapper for window.history.back * - * @method - * @return {jQuery.Deferred} + * @return {jQuery.Promise} Promise which resolves when the back navigation is complete */ -Router.prototype.back = function () { - var deferredRequest = $.Deferred(), - self = this, - timeoutID; +OO.Router.prototype.back = function () { + var timeoutID, + router = this, + deferred = $.Deferred(); this.once( 'popstate', function () { clearTimeout( timeoutID ); - deferredRequest.resolve(); + deferred.resolve(); } ); - this.goBack(); + window.history.back(); // If for some reason (old browser, bug in IE/windows 8.1, etc) popstate doesn't fire, // resolve manually. Since we don't know for sure which browsers besides IE10/11 have @@ -173,33 +201,29 @@ Router.prototype.back = function () { // See https://connect.microsoft.com/IE/feedback/details/793618/history-back-popstate-not-working-as-expected-in-webview-control // Give browser a few ms to update its history. timeoutID = setTimeout( function () { - self.off( 'popstate' ); - deferredRequest.resolve(); + router.off( 'popstate' ); + deferred.resolve(); }, 50 ); - return deferredRequest; + return deferred.promise(); }; /** * Get current path (hash). * - * @method * @return {string} Current path. */ -Router.prototype.getPath = function () { +OO.Router.prototype.getPath = function () { return window.location.hash.slice( 1 ); }; /** - * Determine if current browser supports onhashchange event - * - * @method - * @return {boolean} + * @deprecated Use static method */ -Router.prototype.isSupported = function () { - return 'onhashchange' in window; -}; +OO.Router.prototype.isSupported = OO.Router.static.isSupported; -module.exports = Router; +if ( typeof module !== 'undefined' && module.exports ) { + module.exports = OO.Router; +} }( jQuery ) ); 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() );