X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fincludes%2Fregistration%2FExtensionProcessorTest.php;h=d47ffa9461542358c5179fb44843136199f59aca;hb=8ed7922a5ddda7e8861c232eb6f953d31e679a32;hp=b95316c20b7249b51b42a2cd87f2582e351b962d;hpb=0cd36fec250ffb0afe87dc357abe42d723add3e0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/includes/registration/ExtensionProcessorTest.php b/tests/phpunit/includes/registration/ExtensionProcessorTest.php index b95316c20b..d47ffa9461 100644 --- a/tests/phpunit/includes/registration/ExtensionProcessorTest.php +++ b/tests/phpunit/includes/registration/ExtensionProcessorTest.php @@ -36,6 +36,10 @@ class ExtensionProcessorTest extends MediaWikiTestCase { } public static function provideRegisterHooks() { + // Format: + // Current $wgHooks + // Content in extension.json + // Expected value of $wgHooks return array( // No hooks array( @@ -64,6 +68,22 @@ class ExtensionProcessorTest extends MediaWikiTestCase { 'FooBaz' => array( 'FooBazCallback' ), ), ), + // Callbacks for FooBaz wrapped in an array + array( + array(), + array( 'Hooks' => array( 'FooBaz' => array( 'Callback1' ) ) ) + self::$default, + array( + 'FooBaz' => array( 'Callback1' ), + ), + ), + // Multiple callbacks for FooBaz hook + array( + array(), + array( 'Hooks' => array( 'FooBaz' => array( 'Callback1', 'Callback2' ) ) ) + self::$default, + array( + 'FooBaz' => array( 'Callback1', 'Callback2' ), + ), + ), ); }