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
RevisionStorageTest: use MediaWikiTestCase methods for setting globals
[lhc/web/wiklou.git]
/
tests
/
phpunit
/
includes
/
RevisionStorageTest.php
diff --git
a/tests/phpunit/includes/RevisionStorageTest.php
b/tests/phpunit/includes/RevisionStorageTest.php
index
d098700
..
a15b9b4
100644
(file)
--- a/
tests/phpunit/includes/RevisionStorageTest.php
+++ b/
tests/phpunit/includes/RevisionStorageTest.php
@@
-39,15
+39,31
@@
class RevisionStorageTest extends MediaWikiTestCase {
}
protected function setUp() {
}
protected function setUp() {
- global $wg
ExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wg
ContLang;
+ global $wgContLang;
parent::setUp();
parent::setUp();
- $wgExtraNamespaces[12312] = 'Dummy';
- $wgExtraNamespaces[12313] = 'Dummy_talk';
+ $this->mergeMwGlobalArrayValue(
+ 'wgExtraNamespaces',
+ [
+ 12312 => 'Dummy',
+ 12313 => 'Dummy_talk',
+ ]
+ );
+
+ $this->mergeMwGlobalArrayValue(
+ 'wgNamespaceContentModels',
+ [
+ 12312 => 'DUMMY',
+ ]
+ );
- $wgNamespaceContentModels[12312] = 'DUMMY';
- $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting';
+ $this->mergeMwGlobalArrayValue(
+ 'wgContentHandlers',
+ [
+ 'DUMMY' => 'DummyContentHandlerForTesting',
+ ]
+ );
MWNamespace::clearCaches();
// Reset namespace cache
MWNamespace::clearCaches();
// Reset namespace cache
@@
-64,16
+80,10
@@
class RevisionStorageTest extends MediaWikiTestCase {
}
protected function tearDown() {
}
protected function tearDown() {
- global $wg
ExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wg
ContLang;
+ global $wgContLang;
parent::tearDown();
parent::tearDown();
- unset( $wgExtraNamespaces[12312] );
- unset( $wgExtraNamespaces[12313] );
-
- unset( $wgNamespaceContentModels[12312] );
- unset( $wgContentHandlers['DUMMY'] );
-
MWNamespace::clearCaches();
// Reset namespace cache
$wgContLang->resetNamespaces();
MWNamespace::clearCaches();
// Reset namespace cache
$wgContLang->resetNamespaces();