X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FRevisionStorageTest.php;h=a15b9b4407dc9019cf516c6fdaff52f636a4a425;hp=d09870061ce9da7d6ac15e7a5b3bc82a54303873;hb=cfc57ed7a3a22906a6cbb076ffb2ef52951f5eed;hpb=aa57608c0d4bdc060bd319fa013978691573b338 diff --git a/tests/phpunit/includes/RevisionStorageTest.php b/tests/phpunit/includes/RevisionStorageTest.php index d09870061c..a15b9b4407 100644 --- a/tests/phpunit/includes/RevisionStorageTest.php +++ b/tests/phpunit/includes/RevisionStorageTest.php @@ -39,15 +39,31 @@ class RevisionStorageTest extends MediaWikiTestCase { } protected function setUp() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; + global $wgContLang; 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 @@ -64,16 +80,10 @@ class RevisionStorageTest extends MediaWikiTestCase { } protected function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; + global $wgContLang; parent::tearDown(); - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers['DUMMY'] ); - MWNamespace::clearCaches(); // Reset namespace cache $wgContLang->resetNamespaces();