<?php
+
+/**
+ * @covers RepoGroup
+ */
class RepoGroupTest extends MediaWikiTestCase {
function testHasForeignRepoNegative() {
function testForEachForeignRepo() {
$this->setUpForeignRepo();
- $fakeCallback = $this->getMock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->createMock( RepoGroupTestHelper::class );
$fakeCallback->expects( $this->once() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
[ $fakeCallback, 'callback' ], [ [] ] );
$this->setMwGlobals( 'wgForeignFileRepos', [] );
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
- $fakeCallback = $this->getMock( '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',