MediaWiki REL1_39
MediaWiki\ResourceLoader\Hook\ResourceLoaderTestModulesHook Interface Reference

This is a hook handler interface, see docs/ More...

Inheritance diagram for MediaWiki\ResourceLoader\Hook\ResourceLoaderTestModulesHook:

Public Member Functions

 onResourceLoaderTestModules (array &$testModules, ResourceLoader $rl)
 Register QUnit tests to load on [[Special:JavaScriptTest]].

Detailed Description

This is a hook handler interface, see docs/

Use the hook name "ResourceLoaderTestModules" to register handlers implementing this interface.

since 1.33; use the QUnitTestModule static extension registration attribute instead.

Definition at line 14 of file ResourceLoaderTestModulesHook.php.

Member Function Documentation

◆ onResourceLoaderTestModules()

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' => [ '' ]
void This hook must not abort, it must return no value

Implemented in MediaWiki\ResourceLoader\HookRunner.

The documentation for this interface was generated from the following file: