diff options
author | jenkins-bot <jenkins-bot@gerrit.wikimedia.org> | 2021-12-21 15:53:21 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@wikimedia.org> | 2021-12-21 15:53:21 +0000 |
commit | 73f008e0268fe0c0ddc17221c180540c37c20a4b (patch) | |
tree | 2656f8b7ab081fc6b51de994b6219406e65d538a | |
parent | 26598c1574a8d5c8a0cd9291e1990b5c5914b320 (diff) | |
parent | 9f9426697caa438ca4d9a2ac8ada1949fd6723ee (diff) |
Merge "Replace usages of deprecated wfWikiID()"
16 files changed, 23 insertions, 23 deletions
diff --git a/tests/parser/ParserTestRunner.php b/tests/parser/ParserTestRunner.php index 7550ec2138d3..2f6d82352b14 100644 --- a/tests/parser/ParserTestRunner.php +++ b/tests/parser/ParserTestRunner.php @@ -437,7 +437,7 @@ class ParserTestRunner { } $backend = new FSFileBackend( [ 'name' => 'local-backend', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'basePath' => $this->uploadDir, 'tmpDirectory' => wfTempDir() ] ); @@ -463,7 +463,7 @@ class ParserTestRunner { # informations. $backend = new MockFileBackend( [ 'name' => 'local-backend', - 'wikiId' => wfWikiID() + 'wikiId' => WikiMap::getCurrentWikiId() ] ); } diff --git a/tests/phpunit/includes/WikiMapTest.php b/tests/phpunit/includes/WikiMapTest.php index fa3d8f431d45..04ecd91e9e12 100644 --- a/tests/phpunit/includes/WikiMapTest.php +++ b/tests/phpunit/includes/WikiMapTest.php @@ -239,9 +239,9 @@ class WikiMapTest extends MediaWikiLangTestCase { public function provideGetWikiIdFromDbDomain() { return [ [ 'db-prefix_', 'db-prefix_' ], - [ wfWikiID(), wfWikiID() ], + [ WikiMap::getCurrentWikiId(), WikiMap::getCurrentWikiId() ], [ new DatabaseDomain( 'db-dash', null, 'prefix_' ), 'db-dash-prefix_' ], - [ wfWikiID(), wfWikiID() ], + [ WikiMap::getCurrentWikiId(), WikiMap::getCurrentWikiId() ], [ new DatabaseDomain( 'db-dash', null, 'prefix_' ), 'db-dash-prefix_' ], [ new DatabaseDomain( 'db', 'mediawiki', 'prefix_' ), 'db-prefix_' ], // schema ignored [ new DatabaseDomain( 'db', 'custom', 'prefix_' ), 'db-custom-prefix_' ], diff --git a/tests/phpunit/includes/api/ApiUploadTest.php b/tests/phpunit/includes/api/ApiUploadTest.php index 34f82eda6ba7..e834fb8df223 100644 --- a/tests/phpunit/includes/api/ApiUploadTest.php +++ b/tests/phpunit/includes/api/ApiUploadTest.php @@ -23,7 +23,7 @@ class ApiUploadTest extends ApiUploadTestCase { 'name' => 'temp', 'backend' => new FSFileBackend( [ 'name' => 'temp-backend', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'basePath' => $this->getNewTempDirectory() ] ) ], diff --git a/tests/phpunit/includes/db/LBFactoryTest.php b/tests/phpunit/includes/db/LBFactoryTest.php index c928e5662d16..940705c1a660 100644 --- a/tests/phpunit/includes/db/LBFactoryTest.php +++ b/tests/phpunit/includes/db/LBFactoryTest.php @@ -441,7 +441,7 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { $db = $lb->getConnectionRef( DB_PRIMARY ); $this->assertEquals( - wfWikiID(), + WikiMap::getCurrentWikiId(), $db->getDomainID() ); unset( $db ); @@ -677,7 +677,7 @@ class LBFactoryTest extends MediaWikiIntegrationTestCase { $conn1 = $lb->getConnectionRef( DB_PRIMARY ); $this->assertEquals( - wfWikiID(), + WikiMap::getCurrentWikiId(), $conn1->getDomainID() ); unset( $conn1 ); diff --git a/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php b/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php index 94b766299a85..0fa00e56ee46 100644 --- a/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendGroupIntegrationTest.php @@ -9,7 +9,7 @@ class FileBackendGroupIntegrationTest extends MediaWikiIntegrationTestCase { use FileBackendGroupTestTrait; private static function getWikiID() { - return wfWikiID(); + return WikiMap::getCurrentWikiId(); } private function getLockManagerGroupFactory( $domain ): LockManagerGroupFactory { diff --git a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php index 3479a6d65e00..a1385e078805 100644 --- a/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php +++ b/tests/phpunit/includes/filebackend/FileBackendIntegrationTest.php @@ -86,7 +86,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { $this->singleBackend = new FSFileBackend( [ 'name' => 'localtesting', 'lockManager' => $lockManagerGroup->get( 'fsLockManager' ), - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'logger' => LoggerFactory::getInstance( 'FileOperation' ), 'containerPaths' => [ 'unittest-cont1' => "{$tmpDir}/localtesting-cont1", @@ -2506,7 +2506,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { $be = TestingAccessWrapper::newFromObject( new FileBackendMultiWrite( [ 'name' => 'localtesting', - 'wikiId' => wfWikiID() . mt_rand(), + 'wikiId' => WikiMap::getCurrentWikiId() . mt_rand(), 'backends' => [ [ // backend 0 'name' => 'multitesting0', @@ -2556,7 +2556,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { $be = TestingAccessWrapper::newFromObject( new FileBackendMultiWrite( [ 'name' => 'localtesting', - 'wikiId' => wfWikiID() . mt_rand(), + 'wikiId' => WikiMap::getCurrentWikiId() . mt_rand(), 'backends' => [ [ // backend 0 'name' => 'multitesting0', @@ -2601,7 +2601,7 @@ class FileBackendIntegrationTest extends MediaWikiIntegrationTestCase { public function testSanitizeOpHeaders() { $be = TestingAccessWrapper::newFromObject( new MemoryFileBackend( [ 'name' => 'localtesting', - 'wikiId' => wfWikiID() + 'wikiId' => WikiMap::getCurrentWikiId() ] ) ); $input = [ diff --git a/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php index 6a24ffe31bfc..c9cfe36e0e46 100644 --- a/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php +++ b/tests/phpunit/includes/filerepo/FileBackendDBRepoWrapperTest.php @@ -120,7 +120,7 @@ class FileBackendDBRepoWrapperTest extends MediaWikiIntegrationTestCase { $backendMock = $this->getMockBuilder( FSFileBackend::class ) ->setConstructorArgs( [ [ 'name' => $this->backendName, - 'wikiId' => wfWikiID() + 'wikiId' => WikiMap::getCurrentWikiId() ] ] ) ->getMock(); diff --git a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php index c34ee1687175..df2f6248bafc 100644 --- a/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php +++ b/tests/phpunit/includes/filerepo/MigrateFileRepoLayoutTest.php @@ -18,7 +18,7 @@ class MigrateFileRepoLayoutTest extends MediaWikiIntegrationTestCase { $backend = new FSFileBackend( [ 'name' => 'local-migratefilerepolayouttest', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'containerPaths' => [ 'migratefilerepolayouttest-original' => "{$this->tmpPrefix}-original", 'migratefilerepolayouttest-public' => "{$this->tmpPrefix}-public", diff --git a/tests/phpunit/includes/filerepo/StoreBatchTest.php b/tests/phpunit/includes/filerepo/StoreBatchTest.php index 55d17182db9c..b921fbe2a90f 100644 --- a/tests/phpunit/includes/filerepo/StoreBatchTest.php +++ b/tests/phpunit/includes/filerepo/StoreBatchTest.php @@ -33,7 +33,7 @@ class StoreBatchTest extends MediaWikiIntegrationTestCase { } else { $backend = new FSFileBackend( [ 'name' => 'local-testing', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'containerPaths' => [ 'unittests-public' => "{$tmpPrefix}/public", 'unittests-thumb' => "{$tmpPrefix}/thumb", diff --git a/tests/phpunit/includes/filerepo/file/FileTest.php b/tests/phpunit/includes/filerepo/file/FileTest.php index 8e0da2ea592d..6e28b85717ea 100644 --- a/tests/phpunit/includes/filerepo/file/FileTest.php +++ b/tests/phpunit/includes/filerepo/file/FileTest.php @@ -139,7 +139,7 @@ class FileTest extends MediaWikiMediaTestCase { */ public function testGetThumbnailSource( $data ) { $backendMock = $this->getMockBuilder( FSFileBackend::class ) - ->setConstructorArgs( [ [ 'name' => 'backendMock', 'wikiId' => wfWikiID() ] ] ) + ->setConstructorArgs( [ [ 'name' => 'backendMock', 'wikiId' => WikiMap::getCurrentWikiId() ] ] ) ->getMock(); $repoMock = $this->getMockBuilder( FileRepo::class ) @@ -252,7 +252,7 @@ class FileTest extends MediaWikiMediaTestCase { $this->setMwGlobals( 'wgThumbnailBuckets', $data['buckets'] ); $backendMock = $this->getMockBuilder( FSFileBackend::class ) - ->setConstructorArgs( [ [ 'name' => 'backendMock', 'wikiId' => wfWikiID() ] ] ) + ->setConstructorArgs( [ [ 'name' => 'backendMock', 'wikiId' => WikiMap::getCurrentWikiId() ] ] ) ->getMock(); $repoMock = $this->getMockBuilder( FileRepo::class ) diff --git a/tests/phpunit/includes/filerepo/file/LocalFileTest.php b/tests/phpunit/includes/filerepo/file/LocalFileTest.php index 3288510f9643..b4453ffae49a 100644 --- a/tests/phpunit/includes/filerepo/file/LocalFileTest.php +++ b/tests/phpunit/includes/filerepo/file/LocalFileTest.php @@ -34,7 +34,7 @@ class LocalFileTest extends MediaWikiIntegrationTestCase { 'transformVia404' => false, 'backend' => new FSFileBackend( [ 'name' => 'local-backend', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'containerPaths' => [ 'cont1' => "/testdir/local-backend/tempimages/cont1", 'cont2' => "/testdir/local-backend/tempimages/cont2" diff --git a/tests/phpunit/includes/interwiki/ClassicInterwikiLookupTest.php b/tests/phpunit/includes/interwiki/ClassicInterwikiLookupTest.php index 98bf1893753a..fcb78f1663a4 100644 --- a/tests/phpunit/includes/interwiki/ClassicInterwikiLookupTest.php +++ b/tests/phpunit/includes/interwiki/ClassicInterwikiLookupTest.php @@ -93,7 +93,7 @@ class ClassicInterwikiLookupTest extends MediaWikiIntegrationTestCase { */ private function populateHash( $thisSite, $local, $global ) { $hash = []; - $hash[ '__sites:' . wfWikiID() ] = $thisSite; + $hash[ '__sites:' . WikiMap::getCurrentWikiId() ] = $thisSite; $globals = []; $locals = []; diff --git a/tests/phpunit/includes/jobqueue/JobQueueTest.php b/tests/phpunit/includes/jobqueue/JobQueueTest.php index 73c392dd85e9..83bdb7ffb138 100644 --- a/tests/phpunit/includes/jobqueue/JobQueueTest.php +++ b/tests/phpunit/includes/jobqueue/JobQueueTest.php @@ -75,7 +75,7 @@ class JobQueueTest extends MediaWikiIntegrationTestCase { if ( !$queue ) { $this->markTestSkipped( $desc ); } - $this->assertEquals( wfWikiID(), $queue->getWiki(), "Proper wiki ID ($desc)" ); + $this->assertEquals( WikiMap::getCurrentWikiId(), $queue->getWiki(), "Proper wiki ID ($desc)" ); $this->assertEquals( WikiMap::getCurrentWikiDbDomain()->getId(), $queue->getDomain(), diff --git a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php index 6ea2ccf29576..9c468e269d86 100644 --- a/tests/phpunit/includes/media/MediaWikiMediaTestCase.php +++ b/tests/phpunit/includes/media/MediaWikiMediaTestCase.php @@ -25,7 +25,7 @@ abstract class MediaWikiMediaTestCase extends MediaWikiIntegrationTestCase { $this->backend = new FSFileBackend( [ 'name' => 'localtesting', - 'wikiId' => wfWikiID(), + 'wikiId' => WikiMap::getCurrentWikiId(), 'containerPaths' => $containers, 'tmpDirectory' => $this->getNewTempDirectory() ] ); diff --git a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php index 187d8d8c7a44..09188236ff55 100644 --- a/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php +++ b/tests/phpunit/includes/resourceloader/ResourceLoaderWikiModuleTest.php @@ -263,7 +263,7 @@ class ResourceLoaderWikiModuleTest extends ResourceLoaderTestCase { new PageIdentityValue( 17, NS_MEDIAWIKI, 'Common.css', PageIdentity::LOCAL ), null, null, - wfWikiID() + WikiMap::getCurrentWikiId() ); TestResourceLoaderWikiModule::preloadTitleInfo( $context, diff --git a/tests/phpunit/unit/includes/filebackend/FileBackendGroupTestTrait.php b/tests/phpunit/unit/includes/filebackend/FileBackendGroupTestTrait.php index 58cfa1466e59..5dbd5afecdb1 100644 --- a/tests/phpunit/unit/includes/filebackend/FileBackendGroupTestTrait.php +++ b/tests/phpunit/unit/includes/filebackend/FileBackendGroupTestTrait.php @@ -29,7 +29,7 @@ trait FileBackendGroupTestTrait { abstract protected function getLockManagerGroupFactory( $domain ): LockManagerGroupFactory; /** - * @return string As from wfWikiID() + * @return string As from WikiMap::getCurrentWikiId() */ abstract protected static function getWikiID(); |