X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2FPagePropsTest.php;h=646b487691d4a4f02fa3cf4ad14a856404d411eb;hb=e96b9055fbd4658087b99ef35f118bd618cafa26;hp=f602cdabcf45f386bc0caeec20a9b4cb0f042f13;hpb=11ee7f78da9776db26098642a151a288f98bea14;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/PagePropsTest.php b/tests/phpunit/includes/PagePropsTest.php index f602cdabcf..646b487691 100644 --- a/tests/phpunit/includes/PagePropsTest.php +++ b/tests/phpunit/includes/PagePropsTest.php @@ -27,18 +27,20 @@ class PagePropsTest extends MediaWikiLangTestCase { private $the_properties; protected function setUp() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - parent::setUp(); - $wgExtraNamespaces[12312] = 'Dummy'; - $wgExtraNamespaces[12313] = 'Dummy_talk'; - - $wgNamespaceContentModels[12312] = 'DUMMY'; - $wgContentHandlers['DUMMY'] = 'DummyContentHandlerForTesting'; + $this->setMwGlobals( [ + 'wgExtraNamespaces' => [ + 12312 => 'Dummy', + 12313 => 'Dummy_talk', + ], + 'wgNamespaceContentModels' => [ 12312 => 'DUMMY' ], + ] ); - MWNamespace::clearCaches(); - $wgContLang->resetNamespaces(); # reset namespace cache + $this->mergeMwGlobalArrayValue( + 'wgContentHandlers', + [ 'DUMMY' => 'DummyContentHandlerForTesting' ] + ); if ( !$this->the_properties ) { $this->the_properties = [ @@ -72,21 +74,6 @@ class PagePropsTest extends MediaWikiLangTestCase { } } - protected function tearDown() { - global $wgExtraNamespaces, $wgNamespaceContentModels, $wgContentHandlers, $wgContLang; - - parent::tearDown(); - - unset( $wgExtraNamespaces[12312] ); - unset( $wgExtraNamespaces[12313] ); - - unset( $wgNamespaceContentModels[12312] ); - unset( $wgContentHandlers['DUMMY'] ); - - MWNamespace::clearCaches(); - $wgContLang->resetNamespaces(); # reset namespace cache - } - /** * Test getting a single property from a single page. The property was * set in setUp().