dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Change php extract() to explicit code"
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
filerepo
/
RepoGroupTest.php
diff --git
a/tests/phpunit/includes/filerepo/RepoGroupTest.php
b/tests/phpunit/includes/filerepo/RepoGroupTest.php
index
5bdb7e7
..
6f04c66
100644
(file)
--- a/
tests/phpunit/includes/filerepo/RepoGroupTest.php
+++ b/
tests/phpunit/includes/filerepo/RepoGroupTest.php
@@
-1,8
+1,12
@@
<?php
<?php
+
+/**
+ * @covers RepoGroup
+ */
class RepoGroupTest extends MediaWikiTestCase {
function testHasForeignRepoNegative() {
class RepoGroupTest extends MediaWikiTestCase {
function testHasForeignRepoNegative() {
- $this->setMwGlobals( 'wgForeignFileRepos',
array()
);
+ $this->setMwGlobals( 'wgForeignFileRepos',
[]
);
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
$this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
$this->assertFalse( RepoGroup::singleton()->hasForeignRepos() );
@@
-15,25
+19,25
@@
class RepoGroupTest extends MediaWikiTestCase {
function testForEachForeignRepo() {
$this->setUpForeignRepo();
function testForEachForeignRepo() {
$this->setUpForeignRepo();
- $fakeCallback = $this->
get
Mock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->
create
Mock( 'RepoGroupTestHelper' );
$fakeCallback->expects( $this->once() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
$fakeCallback->expects( $this->once() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
-
array( $fakeCallback, 'callback' ), array( array() )
);
+
[ $fakeCallback, 'callback' ], [ [] ]
);
}
function testForEachForeignRepoNone() {
}
function testForEachForeignRepoNone() {
- $this->setMwGlobals( 'wgForeignFileRepos',
array()
);
+ $this->setMwGlobals( 'wgForeignFileRepos',
[]
);
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
- $fakeCallback = $this->
get
Mock( 'RepoGroupTestHelper' );
+ $fakeCallback = $this->
create
Mock( 'RepoGroupTestHelper' );
$fakeCallback->expects( $this->never() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
$fakeCallback->expects( $this->never() )->method( 'callback' );
RepoGroup::singleton()->forEachForeignRepo(
-
array( $fakeCallback, 'callback' ), array( array() )
);
+
[ $fakeCallback, 'callback' ], [ [] ]
);
}
private function setUpForeignRepo() {
global $wgUploadDirectory;
}
private function setUpForeignRepo() {
global $wgUploadDirectory;
- $this->setMwGlobals( 'wgForeignFileRepos',
array( array(
+ $this->setMwGlobals( 'wgForeignFileRepos',
[ [
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
'backend' => 'wikimediacommons-backend',
'class' => 'ForeignAPIRepo',
'name' => 'wikimediacommons',
'backend' => 'wikimediacommons-backend',
@@
-43,7
+47,7
@@
class RepoGroupTest extends MediaWikiTestCase {
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
'directory' => $wgUploadDirectory
'descriptionCacheExpiry' => 43200,
'apiThumbCacheExpiry' => 86400,
'directory' => $wgUploadDirectory
-
) )
);
+
] ]
);
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
}
RepoGroup::destroySingleton();
FileBackendGroup::destroySingleton();
}