Use QUnitTestModule instead of deprecated ResourceLoaderTestModules

Bug: T232875
Change-Id: I84276ff7c30b9c1db5dd8e9532512d7f586ab401
This commit is contained in:
James D. Forrester 2020-05-11 13:18:02 -07:00 committed by Reedy
parent 8829e2335c
commit 85e56bb200
2 changed files with 12 additions and 26 deletions

View file

@ -137,15 +137,24 @@
"localBasePath": "resources",
"remoteExtPath": "CodeMirror/resources"
},
"QUnitTestModule": {
"localBasePath": "",
"remoteExtPath": "CodeMirror",
"scripts": [
"resources/mode/mediawiki/tests/qunit/CodeMirror.mediawiki.test.js"
],
"dependencies": [
"ext.CodeMirror.data",
"ext.CodeMirror.lib",
"ext.CodeMirror.mode.mediawiki"
]
},
"Hooks": {
"BeforePageDisplay": [
"CodeMirrorHooks::onBeforePageDisplay"
],
"GetPreferences": [
"CodeMirrorHooks::onGetPreferences"
],
"ResourceLoaderTestModules": [
"CodeMirrorHooks::onResourceLoaderTestModules"
]
},
"VisualEditorPluginModules": [

View file

@ -61,27 +61,4 @@ class CodeMirrorHooks {
];
}
/**
* Register test modules for CodeMirror.
*
* @see https://www.mediawiki.org/wiki/Manual:Hooks/ResourceLoaderTestModules
*
* @param array &$modules
* @param ResourceLoader $rl
*/
public static function onResourceLoaderTestModules( array &$modules, ResourceLoader $rl ) {
$modules['qunit']['ext.CodeMirror.test'] = [
'scripts' => [
'resources/mode/mediawiki/tests/qunit/CodeMirror.mediawiki.test.js',
],
'dependencies' => [
'ext.CodeMirror.data',
'ext.CodeMirror.lib',
'ext.CodeMirror.mode.mediawiki',
],
'localBasePath' => __DIR__ . '/../',
'remoteExtPath' => 'CodeMirror',
];
}
}