Merge "Remove parameter 'options' from hook 'SkinEditSectionLinks'"
[lhc/web/wiklou.git] / tests / phpunit / includes / filerepo / RepoGroupTest.php
index 6f04c66..67de698 100644 (file)
@@ -7,7 +7,7 @@ class RepoGroupTest extends MediaWikiTestCase {
 
        function testHasForeignRepoNegative() {
                $this->setMwGlobals( 'wgForeignFileRepos', [] );
-               RepoGroup::destroySingleton();
+               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
                $this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
        }
@@ -19,7 +19,7 @@ class RepoGroupTest extends MediaWikiTestCase {
 
        function testForEachForeignRepo() {
                $this->setUpForeignRepo();
-               $fakeCallback = $this->createMock( 'RepoGroupTestHelper' );
+               $fakeCallback = $this->createMock( RepoGroupTestHelper::class );
                $fakeCallback->expects( $this->once() )->method( 'callback' );
                RepoGroup::singleton()->forEachForeignRepo(
                        [ $fakeCallback, 'callback' ], [ [] ] );
@@ -27,9 +27,9 @@ class RepoGroupTest extends MediaWikiTestCase {
 
        function testForEachForeignRepoNone() {
                $this->setMwGlobals( 'wgForeignFileRepos', [] );
-               RepoGroup::destroySingleton();
+               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
-               $fakeCallback = $this->createMock( 'RepoGroupTestHelper' );
+               $fakeCallback = $this->createMock( RepoGroupTestHelper::class );
                $fakeCallback->expects( $this->never() )->method( 'callback' );
                RepoGroup::singleton()->forEachForeignRepo(
                        [ $fakeCallback, 'callback' ], [ [] ] );
@@ -38,7 +38,7 @@ class RepoGroupTest extends MediaWikiTestCase {
        private function setUpForeignRepo() {
                global $wgUploadDirectory;
                $this->setMwGlobals( 'wgForeignFileRepos', [ [
-                       'class' => 'ForeignAPIRepo',
+                       'class' => ForeignAPIRepo::class,
                        'name' => 'wikimediacommons',
                        'backend' => 'wikimediacommons-backend',
                        'apibase' => 'https://commons.wikimedia.org/w/api.php',
@@ -48,7 +48,7 @@ class RepoGroupTest extends MediaWikiTestCase {
                        'apiThumbCacheExpiry' => 86400,
                        'directory' => $wgUploadDirectory
                ] ] );
-               RepoGroup::destroySingleton();
+               $this->overrideMwServices();
                FileBackendGroup::destroySingleton();
        }
 }