MediaWiki REL1_39
|
This is a hook handler interface, see docs/Hooks.md. More...
Public Member Functions | |
onResourceLoaderTestModules (array &$testModules, ResourceLoader $rl) | |
Register QUnit tests to load on [[Special:JavaScriptTest]]. | |
This is a hook handler interface, see docs/Hooks.md.
Use the hook name "ResourceLoaderTestModules" to register handlers implementing this interface.
Definition at line 14 of file ResourceLoaderTestModulesHook.php.
MediaWiki\ResourceLoader\Hook\ResourceLoaderTestModulesHook::onResourceLoaderTestModules | ( | array & | $testModules, |
ResourceLoader | $rl ) |
Register QUnit tests to load on [[Special:JavaScriptTest]].
The tests files take the form of a ResourceLoader module that will only be registered when $wgEnableJavaScriptTest is true, and automatically discovered and loaded when visiting [[Special:JavaScriptTest]].
The $testModules
array follows the same format as $wgResourceModules, and is additionally keyed by test framework.
For example:
$testModules['qunit']['test.Example'] = [ 'localBasePath' => __DIR__ . '/tests/qunit', 'remoteExtPath' => 'Example/tests/qunit', 'script' => [ 'tests/qunit/foo.test.js' ], 'dependencies' => [ 'ext.Example.foo' ] ];
array | &$testModules | |
ResourceLoader | $rl |
Implemented in MediaWiki\ResourceLoader\HookRunner.