Merge "Don't check namespace in SpecialWantedtemplates"
[lhc/web/wiklou.git] / tests / phpunit / includes / registration / ExtensionRegistryTest.php
index 8674343..201cbfc 100644 (file)
@@ -101,6 +101,50 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                        ),
                                )
                        ),
+                       array(
+                               'Global already set, 1d array that appends',
+                               array(
+                                       'mwAvailableRights' => array(
+                                               'foobar',
+                                               'foo'
+                                       ),
+                               ),
+                               array(
+                                       'mwAvailableRights' => array(
+                                               'barbaz',
+                                       ),
+                               ),
+                               array(
+                                       'mwAvailableRights' => array(
+                                               'barbaz',
+                                               'foobar',
+                                               'foo',
+                                       ),
+                               )
+                       ),
+                       array(
+                               'Global already set, array with integer keys',
+                               array(
+                                       'mwNamespacesFoo' => array(
+                                               100 => true,
+                                               102 => false
+                                       ),
+                               ),
+                               array(
+                                       'mwNamespacesFoo' => array(
+                                               100 => false,
+                                               500 => true,
+                                               ExtensionRegistry::MERGE_STRATEGY => 'array_plus',
+                                       ),
+                               ),
+                               array(
+                                       'mwNamespacesFoo' => array(
+                                               100 => true,
+                                               102 => false,
+                                               500 => true,
+                                       ),
+                               )
+                       ),
                        array(
                                'No global already set, $wgHooks',
                                array(
@@ -111,6 +155,7 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                                'FooBarEvent' => array(
                                                        'FooBarClass::onFooBarEvent'
                                                ),
+                                               ExtensionRegistry::MERGE_STRATEGY => 'array_merge_recursive'
                                        ),
                                ),
                                array(
@@ -138,6 +183,7 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                                'FooBarEvent' => array(
                                                        'BazBarClass::onFooBarEvent',
                                                ),
+                                               ExtensionRegistry::MERGE_STRATEGY => 'array_merge_recursive',
                                        ),
                                ),
                                array(
@@ -173,7 +219,8 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                                        'right' => true,
                                                        'somethingtwo' => false,
                                                        'nonduplicated' => true,
-                                               )
+                                               ),
+                                               ExtensionRegistry::MERGE_STRATEGY => 'array_plus_2d',
                                        ),
                                ),
                                array(
@@ -191,7 +238,19 @@ class ExtensionRegistryTest extends MediaWikiTestCase {
                                                )
                                        ),
                                ),
-                       )
+                       ),
+                       array(
+                               'False local setting should not be overridden (T100767)',
+                               array(
+                                       'mwtestT100767' => false,
+                               ),
+                               array(
+                                       'mwtestT100767' => true,
+                               ),
+                               array(
+                                       'mwtestT100767' => false,
+                               ),
+                       ),
                );
        }
 }