Merge "Fix \n handling for HTMLUsersMultiselectField"
[lhc/web/wiklou.git] / tests / phpunit / includes / resourceloader / ResourceLoaderClientHtmlTest.php
index 528c322..3e0d883 100644 (file)
@@ -1,5 +1,7 @@
 <?php
 
+use Wikimedia\TestingAccessWrapper;
+
 /**
  * @group ResourceLoader
  */
@@ -44,15 +46,29 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
 
                        '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.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 ],
                ];
                return array_map( function ( $options ) {
@@ -90,14 +106,14 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
                ] );
                $client->setModuleStyles( [
                        'test.styles.mixed',
-                       'test.styles.mixed.user.empty',
+                       'test.styles.user.empty',
                        'test.styles.private',
                        'test.styles.pure',
                        'test.unregistered.styles',
                ] );
                $client->setModuleScripts( [
                        'test.scripts',
-                       'test.scripts.mixed.user.empty',
+                       'test.scripts.user.empty',
                        'test.scripts.top',
                        'test.unregistered.scripts',
                ] );
@@ -107,18 +123,17 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
                                'test.private.top' => 'loading',
                                'test.private.bottom' => 'loading',
                                'test.styles.pure' => 'ready',
-                               'test.styles.mixed.user.empty' => 'ready',
+                               'test.styles.user.empty' => 'ready',
                                'test.styles.private' => 'ready',
                                'test.scripts' => 'loading',
                                'test.scripts.top' => 'loading',
-                               'test.scripts.mixed.user.empty' => 'ready',
+                               'test.scripts.user.empty' => 'ready',
                        ],
                        'general' => [
                                'test',
                                'test.top',
                        ],
                        'styles' => [
-                               'test.styles.mixed',
                                'test.styles.pure',
                        ],
                        'scripts' => [
@@ -238,16 +253,22 @@ class ResourceLoaderClientHtmlTest extends PHPUnit_Framework_TestCase {
                        ],
                        [
                                '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 ],
                                'modules' => [ 'test.styles.pure', 'test.styles.mixed' ],
                                'only' => ResourceLoaderModule::TYPE_STYLES,
-                               'output' => '<link rel="stylesheet" href="/w/load.php?debug=true&amp;lang=nl&amp;modules=test.styles.pure&amp;only=styles&amp;skin=fallback"/>' . "\n"
-                                       . '<link rel="stylesheet" href="/w/load.php?debug=true&amp;lang=nl&amp;modules=test.styles.mixed&amp;only=styles&amp;skin=fallback"/>',
+                               'output' => '<link rel="stylesheet" href="/w/load.php?debug=true&amp;lang=nl&amp;modules=test.styles.mixed&amp;only=styles&amp;skin=fallback"/>' . "\n"
+                                       . '<link rel="stylesheet" href="/w/load.php?debug=true&amp;lang=nl&amp;modules=test.styles.pure&amp;only=styles&amp;skin=fallback"/>',
+                       ],
+                       [
+                               'context' => [ 'debug' => false ],
+                               'modules' => [ 'test.styles.pure', 'test.styles.mixed' ],
+                               'only' => ResourceLoaderModule::TYPE_STYLES,
+                               'output' => '<link rel="stylesheet" href="/w/load.php?debug=false&amp;lang=nl&amp;modules=test.styles.mixed%2Cpure&amp;only=styles&amp;skin=fallback"/>',
                        ],
                        [
                                'context' => [],