'test.top' => [ 'position' => 'top' ],
'test.private.top' => [ 'group' => 'private', 'position' => 'top' ],
'test.private.bottom' => [ 'group' => 'private', 'position' => 'bottom' ],
+ 'test.shouldembed.empty' => [ 'shouldEmbed' => true, 'isKnownEmpty' => true ],
+ 'test.shouldembed' => [ 'shouldEmbed' => true ],
'test.styles.pure' => [ 'type' => ResourceLoaderModule::LOAD_STYLES ],
'test.styles.mixed' => [],
- 'test.styles.noscript' => [ 'group' => 'noscript', 'type' => ResourceLoaderModule::LOAD_STYLES ],
- 'test.styles.mixed.user' => [ 'group' => 'user' ],
- 'test.styles.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ],
- 'test.styles.private' => [ 'group' => 'private', 'styles' => '.private{}' ],
+ 'test.styles.noscript' => [
+ 'type' => ResourceLoaderModule::LOAD_STYLES,
+ 'group' => 'noscript',
+ ],
+ 'test.styles.user' => [
+ 'type' => ResourceLoaderModule::LOAD_STYLES,
+ 'group' => 'user',
+ ],
+ 'test.styles.user.empty' => [
+ 'type' => ResourceLoaderModule::LOAD_STYLES,
+ 'group' => 'user',
+ 'isKnownEmpty' => true,
+ ],
+ 'test.styles.private' => [
+ 'type' => ResourceLoaderModule::LOAD_STYLES,
+ 'group' => 'private',
+ 'styles' => '.private{}',
+ ],
+ 'test.styles.shouldembed' => [
+ 'type' => ResourceLoaderModule::LOAD_STYLES,
+ 'shouldEmbed' => true,
+ 'styles' => '.shouldembed{}',
+ ],
'test.scripts' => [],
'test.scripts.top' => [ 'position' => 'top' ],
- 'test.scripts.mixed.user' => [ 'group' => 'user' ],
- 'test.scripts.mixed.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ],
+ 'test.scripts.user' => [ 'group' => 'user' ],
+ 'test.scripts.user.empty' => [ 'group' => 'user', 'isKnownEmpty' => true ],
'test.scripts.raw' => [ 'isRaw' => true ],
+ 'test.scripts.shouldembed' => [ 'shouldEmbed' => true ],
+
+ 'test.ordering.a' => [ 'shouldEmbed' => false ],
+ 'test.ordering.b' => [ 'shouldEmbed' => false ],
+ 'test.ordering.c' => [ 'shouldEmbed' => true, 'styles' => '.orderingC{}' ],
+ 'test.ordering.d' => [ 'shouldEmbed' => true, 'styles' => '.orderingD{}' ],
+ 'test.ordering.e' => [ 'shouldEmbed' => false ],
];
return array_map( function ( $options ) {
return self::makeModule( $options );
'test.private.bottom',
'test.private.top',
'test.top',
+ 'test.shouldembed.empty',
+ 'test.shouldembed',
'test.unregistered',
] );
$client->setModuleStyles( [
'test.styles.mixed',
- 'test.styles.mixed.user.empty',
+ 'test.styles.user.empty',
'test.styles.private',
'test.styles.pure',
+ 'test.styles.shouldembed',
'test.unregistered.styles',
] );
$client->setModuleScripts( [
'test.scripts',
- 'test.scripts.mixed.user.empty',
+ 'test.scripts.user.empty',
'test.scripts.top',
+ 'test.scripts.shouldembed',
'test.unregistered.scripts',
] );
'states' => [
'test.private.top' => 'loading',
'test.private.bottom' => 'loading',
+ 'test.shouldembed.empty' => 'ready',
+ 'test.shouldembed' => 'loading',
'test.styles.pure' => 'ready',
- 'test.styles.mixed.user.empty' => 'ready',
+ 'test.styles.user.empty' => 'ready',
'test.styles.private' => 'ready',
+ 'test.styles.shouldembed' => 'ready',
'test.scripts' => 'loading',
'test.scripts.top' => 'loading',
- 'test.scripts.mixed.user.empty' => 'ready',
+ 'test.scripts.user.empty' => 'ready',
+ 'test.scripts.shouldembed' => 'loading',
],
'general' => [
'test',
'test.top',
],
'styles' => [
- 'test.styles.mixed',
'test.styles.pure',
],
'scripts' => [
'test.scripts',
'test.scripts.top',
+ 'test.scripts.shouldembed',
],
'embed' => [
- 'styles' => [ 'test.styles.private' ],
+ 'styles' => [ 'test.styles.private', 'test.styles.shouldembed' ],
'general' => [
'test.private.bottom',
'test.private.top',
+ 'test.shouldembed',
],
],
];
],
[
'context' => [],
- 'modules' => [ 'test.scripts.mixed.user' ],
+ 'modules' => [ 'test.scripts.user' ],
'only' => ResourceLoaderModule::TYPE_SCRIPTS,
- 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.scripts.mixed.user\u0026only=scripts\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
+ 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test.scripts.user\u0026only=scripts\u0026skin=fallback\u0026user=Example\u0026version=0a56zyi");});</script>',
],
[
'context' => [ 'debug' => true ],
'only' => ResourceLoaderModule::TYPE_STYLES,
'output' => '<noscript><link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.noscript&only=styles&skin=fallback"/></noscript>',
],
+ [
+ 'context' => [],
+ 'modules' => [ 'test.shouldembed' ],
+ 'only' => ResourceLoaderModule::TYPE_COMBINED,
+ 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.implement("test.shouldembed@09p30q0",function($,jQuery,require,module){},{"css":[]});});</script>',
+ ],
+ [
+ 'context' => [],
+ 'modules' => [ 'test.styles.shouldembed' ],
+ 'only' => ResourceLoaderModule::TYPE_STYLES,
+ 'output' => '<style>.shouldembed{}</style>',
+ ],
+ [
+ 'context' => [],
+ 'modules' => [ 'test.scripts.shouldembed' ],
+ 'only' => ResourceLoaderModule::TYPE_SCRIPTS,
+ 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.state({"test.scripts.shouldembed":"ready"});});</script>',
+ ],
+ [
+ 'context' => [],
+ 'modules' => [ 'test', 'test.shouldembed' ],
+ 'only' => ResourceLoaderModule::TYPE_COMBINED,
+ 'output' => '<script>(window.RLQ=window.RLQ||[]).push(function(){mw.loader.load("/w/load.php?debug=false\u0026lang=nl\u0026modules=test\u0026skin=fallback");mw.loader.implement("test.shouldembed@09p30q0",function($,jQuery,require,module){},{"css":[]});});</script>',
+ ],
+ [
+ 'context' => [],
+ 'modules' => [ 'test.styles.pure', 'test.styles.shouldembed' ],
+ 'only' => ResourceLoaderModule::TYPE_STYLES,
+ 'output' =>
+ '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.styles.pure&only=styles&skin=fallback"/>' . "\n"
+ . '<style>.shouldembed{}</style>'
+ ],
+ [
+ 'context' => [],
+ 'modules' => [ 'test.ordering.a', 'test.ordering.e', 'test.ordering.b', 'test.ordering.d', 'test.ordering.c' ],
+ 'only' => ResourceLoaderModule::TYPE_STYLES,
+ 'output' =>
+ '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.ordering.a%2Cb&only=styles&skin=fallback"/>' . "\n"
+ . '<style>.orderingC{}.orderingD{}</style>' . "\n"
+ . '<link rel="stylesheet" href="/w/load.php?debug=false&lang=nl&modules=test.ordering.e&only=styles&skin=fallback"/>'
+ ],
// @codingStandardsIgnoreEnd
];
}