25header(
'Content-Type: text/javascript; charset=utf-8' );
28 'testUsesMissing' =>
"
29mw.loader.implement( 'testUsesMissing', function () {
30 mw.loader.testFail( 'Module usesMissing script should not run.' );
34 'testUsesNestedMissing' =>
"
35mw.loader.implement( 'testUsesNestedMissing', function () {
36 mw.loader.testFail('Module testUsesNestedMissing script should not run.' );
41mw.loader.implement( 'testSkipped', function () {
42 mw.loader.testFail( false, 'Module testSkipped was supposed to be skipped.' );
47mw.loader.implement( 'testNotSkipped', function () {}, {}, {});
50 'testUsesSkippable' =>
"
51mw.loader.implement( 'testUsesSkippable', function () {}, {}, {});
55mw.loader.implement( 'testUrlInc', function () {} );
58mw.loader.implement( 'testUrlInc.a', function () {} );
61mw.loader.implement( 'testUrlInc.b', function () {} );
64mw.loader.implement( 'testUrlOrder', function () {} );
67mw.loader.implement( 'testUrlOrder.a', function () {} );
70mw.loader.implement( 'testUrlOrder.b', function () {} );
79if ( isset( $_GET[
'modules'] ) ) {
80 if ( $_GET[
'modules'] ===
'testUrlInc,testUrlIncDump|testUrlInc.a,b' ) {
81 $modules = [
'testUrlInc',
'testUrlIncDump',
'testUrlInc.a',
'testUrlInc.b' ];
82 } elseif ( $_GET[
'modules'] ===
'testUrlOrder,testUrlOrderDump|testUrlOrder.a,b' ) {
83 $modules = [
'testUrlOrder',
'testUrlOrderDump',
'testUrlOrder.a',
'testUrlOrder.b' ];
85 $modules = explode(
',', $_GET[
'modules'] );
90 } elseif ( preg_match(
'/^test.*Dump$/', $module ) === 1 ) {
91 $queryModules = $_GET[
'modules'];
92 $queryVersion = isset( $_GET[
'version'] ) ? strval( $_GET[
'version'] ) :
null;
93 $response .=
'mw.loader.implement( ' . json_encode( $module )
94 .
', function ( $, jQuery, require, module ) {'
95 .
'module.exports.query = { '
96 .
'modules: ' . json_encode( $queryModules ) .
','
97 .
'version: ' . json_encode( $queryVersion )
102 $response .=
'mw.loader.state(' . json_encode( $module ) .
', "missing" );' .
"\n";