X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fregistration%2FExtensionRegistryTest.php;h=201cbfcdf1191ffdca81d954f4fb5a433808a10e;hb=59ebff658ce912c1b0e7ef8d8f9bfec5a4e17b39;hp=8674343447141f62533b2ffc1a9dc88d0b27d268;hpb=4760e057bb2f4db09ca395ec43d0172c92a42e19;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/registration/ExtensionRegistryTest.php b/tests/phpunit/includes/registration/ExtensionRegistryTest.php index 8674343447..201cbfcdf1 100644 --- a/tests/phpunit/includes/registration/ExtensionRegistryTest.php +++ b/tests/phpunit/includes/registration/ExtensionRegistryTest.php @@ -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, + ), + ), ); } }