class RepoGroupTest extends MediaWikiTestCase {
function testHasForeignRepoNegative() {
- $this->setMwGlobals( 'wgForeignFileRepos', array() );
+ $this->setMwGlobals( 'wgForeignFileRepos', [] );
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
$this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
function testForEachForeignRepo() {
$this->setUpForeignRepo();
- $fakeCallback = $this->getMock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->createMock( 'RepoGroupTestHelper' );
$fakeCallback->expects( $this->once() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
- array( $fakeCallback, 'callback' ), array( array() ) );
+ [ $fakeCallback, 'callback' ], [ [] ] );
}
function testForEachForeignRepoNone() {
- $this->setMwGlobals( 'wgForeignFileRepos', array() );
+ $this->setMwGlobals( 'wgForeignFileRepos', [] );
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
- $fakeCallback = $this->getMock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->createMock( 'RepoGroupTestHelper' );
$fakeCallback->expects( $this->never() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
- array( $fakeCallback, 'callback' ), array( array() ) );
+ [ $fakeCallback, 'callback' ], [ [] ] );
}
private function setUpForeignRepo() {
global $wgUploadDirectory;
- $this->setMwGlobals( 'wgForeignFileRepos', array( array(
+ $this->setMwGlobals( 'wgForeignFileRepos', [ [
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
'backend' => 'wikimediacommons-backend',
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
'directory' => $wgUploadDirectory
- ) ) );
+ ] ] );
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
}