function testHasForeignRepoNegative() {
$this->setMwGlobals( 'wgForeignFileRepos', [] );
- RepoGroup::destroySingleton();
+ $this->overrideMwServices();
FileBackendGroup::destroySingleton();
$this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
}
function testForEachForeignRepo() {
$this->setUpForeignRepo();
- $fakeCallback = $this->createMock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->createMock( RepoGroupTestHelper::class );
$fakeCallback->expects( $this->once() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
[ $fakeCallback, 'callback' ], [ [] ] );
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' ], [ [] ] );
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',
'apiThumbCacheExpiry' => 86400,
'directory' => $wgUploadDirectory
] ] );
- RepoGroup::destroySingleton();
+ $this->overrideMwServices();
FileBackendGroup::destroySingleton();
}
}