Merge "Allow skins/extensions to define custom OOUI themes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 15 Jul 2019 20:21:01 +0000 (20:21 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 15 Jul 2019 20:21:01 +0000 (20:21 +0000)
18 files changed:
docs/extension.schema.v1.json
docs/extension.schema.v2.json
includes/registration/ExtensionProcessor.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderFilePath.php
includes/resourceloader/ResourceLoaderImage.php
includes/resourceloader/ResourceLoaderImageModule.php
includes/resourceloader/ResourceLoaderOOUIImageModule.php
includes/resourceloader/ResourceLoaderOOUIModule.php
tests/phpunit/data/rlfilepath/eye.svg [new file with mode: 0644]
tests/phpunit/data/rlfilepath/flag-ltr.svg [new file with mode: 0644]
tests/phpunit/data/rlfilepath/flag-rtl.svg [new file with mode: 0644]
tests/phpunit/data/rlfilepath/script.js [new file with mode: 0644]
tests/phpunit/data/rlfilepath/skinStyle.css [new file with mode: 0644]
tests/phpunit/data/rlfilepath/style.css [new file with mode: 0644]
tests/phpunit/data/rlfilepath/template.html [new file with mode: 0644]
tests/phpunit/includes/resourceloader/ResourceLoaderFileModuleTest.php
tests/phpunit/includes/resourceloader/ResourceLoaderImageModuleTest.php

index 86fa1b3..9ce016f 100644 (file)
                "SkinOOUIThemes": {
                        "type": "object"
                },
+               "OOUIThemePaths": {
+                       "type": "object",
+                       "description": "Map of custom OOUI theme names to paths to load them from. Same format as ResourceLoaderOOUIModule::$builtinThemePaths.",
+                       "patternProperties": {
+                               "^[A-Za-z]+$": {
+                                       "type": "object",
+                                       "additionalProperties": false,
+                                       "properties": {
+                                               "scripts": {
+                                                       "type": "string",
+                                                       "description": "Path to script file."
+                                               },
+                                               "styles": {
+                                                       "type": "string",
+                                                       "description": "Path to style files. '{module}' will be replaced with the module's name."
+                                               },
+                                               "images": {
+                                                       "type": [ "string", "null" ],
+                                                       "description": "Path to images (optional). '{module}' will be replaced with the module's name."
+                                               }
+                                       }
+                               }
+                       }
+               },
                "PasswordPolicy": {
                        "type": "object",
                        "description": "Password policies"
index c1db2b6..9d874f4 100644 (file)
                        "type": "object",
                        "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
                },
+               "OOUIThemePaths": {
+                       "type": "object",
+                       "description": "Map of custom OOUI theme names to paths to load them from. Same format as ResourceLoaderOOUIModule::$builtinThemePaths.",
+                       "patternProperties": {
+                               "^[A-Za-z]+$": {
+                                       "type": "object",
+                                       "additionalProperties": false,
+                                       "properties": {
+                                               "scripts": {
+                                                       "type": "string",
+                                                       "description": "Path to script file."
+                                               },
+                                               "styles": {
+                                                       "type": "string",
+                                                       "description": "Path to style files. '{module}' will be replaced with the module's name."
+                                               },
+                                               "images": {
+                                                       "type": [ "string", "null" ],
+                                                       "description": "Path to images (optional). '{module}' will be replaced with the module's name."
+                                               }
+                                       }
+                               }
+                       }
+               },
                "PasswordPolicy": {
                        "type": "object",
                        "description": "Password policies"
index e71de84..6182d5f 100644 (file)
@@ -120,6 +120,7 @@ class ExtensionProcessor implements Processor {
                'ResourceFileModulePaths',
                'ResourceModules',
                'ResourceModuleSkinStyles',
+               'OOUIThemePaths',
                'QUnitTestModule',
                'ExtensionMessagesFiles',
                'MessagesDirs',
@@ -445,7 +446,7 @@ class ExtensionProcessor implements Processor {
                        }
                }
 
-               foreach ( [ 'ResourceModules', 'ResourceModuleSkinStyles' ] as $setting ) {
+               foreach ( [ 'ResourceModules', 'ResourceModuleSkinStyles', 'OOUIThemePaths' ] as $setting ) {
                        if ( isset( $info[$setting] ) ) {
                                foreach ( $info[$setting] as $name => $data ) {
                                        if ( isset( $data['localBasePath'] ) ) {
@@ -459,7 +460,11 @@ class ExtensionProcessor implements Processor {
                                        if ( $defaultPaths ) {
                                                $data += $defaultPaths;
                                        }
-                                       $this->globals["wg$setting"][$name] = $data;
+                                       if ( $setting === 'OOUIThemePaths' ) {
+                                               $this->attributes[$setting][$name] = $data;
+                                       } else {
+                                               $this->globals["wg$setting"][$name] = $data;
+                                       }
                                }
                        }
                }
index 017b399..fbc59fe 100644 (file)
@@ -256,11 +256,11 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                                case 'debugScripts':
                                case 'styles':
                                case 'packageFiles':
-                                       $this->{$member} = (array)$option;
+                                       $this->{$member} = is_array( $option ) ? $option : [ $option ];
                                        break;
                                case 'templates':
                                        $hasTemplates = true;
-                                       $this->{$member} = (array)$option;
+                                       $this->{$member} = is_array( $option ) ? $option : [ $option ];
                                        break;
                                // Collated lists of file paths
                                case 'languageScripts':
@@ -279,7 +279,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                                                                "'$key' given, string expected."
                                                        );
                                                }
-                                               $this->{$member}[$key] = (array)$value;
+                                               $this->{$member}[$key] = is_array( $value ) ? $value : [ $value ];
                                        }
                                        break;
                                case 'deprecated':
@@ -315,7 +315,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                        // Ensure relevant template compiler module gets loaded
                        foreach ( $this->templates as $alias => $templatePath ) {
                                if ( is_int( $alias ) ) {
-                                       $alias = $templatePath;
+                                       $alias = $this->getPath( $templatePath );
                                }
                                $suffix = explode( '.', $alias );
                                $suffix = end( $suffix );
@@ -643,6 +643,18 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                return $summary;
        }
 
+       /**
+        * @param string|ResourceLoaderFilePath $path
+        * @return string
+        */
+       protected function getPath( $path ) {
+               if ( $path instanceof ResourceLoaderFilePath ) {
+                       return $path->getPath();
+               }
+
+               return $path;
+       }
+
        /**
         * @param string|ResourceLoaderFilePath $path
         * @return string
@@ -1060,7 +1072,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                foreach ( $this->templates as $alias => $templatePath ) {
                        // Alias is optional
                        if ( is_int( $alias ) ) {
-                               $alias = $templatePath;
+                               $alias = $this->getPath( $templatePath );
                        }
                        $localPath = $this->getLocalPath( $templatePath );
                        if ( file_exists( $localPath ) ) {
index 3cf09d8..c01e507 100644 (file)
@@ -62,6 +62,20 @@ class ResourceLoaderFilePath {
                return "{$this->remoteBasePath}/{$this->path}";
        }
 
+       /**
+        * @return string
+        */
+       public function getLocalBasePath() {
+               return $this->localBasePath;
+       }
+
+       /**
+        * @return string
+        */
+       public function getRemoteBasePath() {
+               return $this->remoteBasePath;
+       }
+
        /**
         * @return string
         */
index 7829b71..9003951 100644 (file)
@@ -95,9 +95,9 @@ class ResourceLoaderImage {
 
                // Ensure that all files have common extension.
                $extensions = [];
-               $descriptor = (array)$this->descriptor;
+               $descriptor = is_array( $this->descriptor ) ? $this->descriptor : [ $this->descriptor ];
                array_walk_recursive( $descriptor, function ( $path ) use ( &$extensions ) {
-                       $extensions[] = pathinfo( $path, PATHINFO_EXTENSION );
+                       $extensions[] = pathinfo( $this->getLocalPath( $path ), PATHINFO_EXTENSION );
                } );
                $extensions = array_unique( $extensions );
                if ( count( $extensions ) !== 1 ) {
@@ -150,31 +150,43 @@ class ResourceLoaderImage {
         */
        public function getPath( ResourceLoaderContext $context ) {
                $desc = $this->descriptor;
-               if ( is_string( $desc ) ) {
-                       return $this->basePath . '/' . $desc;
+               if ( !is_array( $desc ) ) {
+                       return $this->getLocalPath( $desc );
                }
                if ( isset( $desc['lang'] ) ) {
                        $contextLang = $context->getLanguage();
                        if ( isset( $desc['lang'][$contextLang] ) ) {
-                               return $this->basePath . '/' . $desc['lang'][$contextLang];
+                               return $this->getLocalPath( $desc['lang'][$contextLang] );
                        }
                        $fallbacks = Language::getFallbacksFor( $contextLang, Language::STRICT_FALLBACKS );
                        foreach ( $fallbacks as $lang ) {
                                if ( isset( $desc['lang'][$lang] ) ) {
-                                       return $this->basePath . '/' . $desc['lang'][$lang];
+                                       return $this->getLocalPath( $desc['lang'][$lang] );
                                }
                        }
                }
                if ( isset( $desc[$context->getDirection()] ) ) {
-                       return $this->basePath . '/' . $desc[$context->getDirection()];
+                       return $this->getLocalPath( $desc[$context->getDirection()] );
                }
                if ( isset( $desc['default'] ) ) {
-                       return $this->basePath . '/' . $desc['default'];
+                       return $this->getLocalPath( $desc['default'] );
                } else {
                        throw new MWException( 'No matching path found' );
                }
        }
 
+       /**
+        * @param string|ResourceLoaderFilePath $path
+        * @return string
+        */
+       protected function getLocalPath( $path ) {
+               if ( $path instanceof ResourceLoaderFilePath ) {
+                       return $path->getLocalPath();
+               }
+
+               return "{$this->basePath}/$path";
+       }
+
        /**
         * Get the extension of the image.
         *
index 90b18eb..902fa91 100644 (file)
@@ -130,7 +130,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                $this->definition = null;
 
                if ( isset( $options['data'] ) ) {
-                       $dataPath = $this->localBasePath . '/' . $options['data'];
+                       $dataPath = $this->getLocalPath( $options['data'] );
                        $data = json_decode( file_get_contents( $dataPath ), true );
                        $options = array_merge( $data, $options );
                }
@@ -259,7 +259,7 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                                $this->images[$skin] = $this->images['default'] ?? [];
                        }
                        foreach ( $this->images[$skin] as $name => $options ) {
-                               $fileDescriptor = is_string( $options ) ? $options : $options['file'];
+                               $fileDescriptor = is_array( $options ) ? $options['file'] : $options;
 
                                $allowedVariants = array_merge(
                                        ( is_array( $options ) && isset( $options['variants'] ) ) ? $options['variants'] : [],
@@ -452,6 +452,18 @@ class ResourceLoaderImageModule extends ResourceLoaderModule {
                return array_map( [ __CLASS__, 'safeFileHash' ], $files );
        }
 
+       /**
+        * @param string|ResourceLoaderFilePath $path
+        * @return string
+        */
+       protected function getLocalPath( $path ) {
+               if ( $path instanceof ResourceLoaderFilePath ) {
+                       return $path->getLocalPath();
+               }
+
+               return "{$this->localBasePath}/$path";
+       }
+
        /**
         * Extract a local base path from module definition information.
         *
index 34079c3..c6d4cdf 100644 (file)
@@ -97,6 +97,9 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule {
                // Find the path to the JSON file which contains the actual image definitions for this theme
                if ( $module ) {
                        $dataPath = $this->getThemeImagesPath( $theme, $module );
+                       if ( !$dataPath ) {
+                               return false;
+                       }
                } else {
                        // Backwards-compatibility for things that probably shouldn't have used this class...
                        $dataPath =
@@ -116,7 +119,7 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule {
         * @return array|false
         */
        protected function readJSONFile( $dataPath ) {
-               $localDataPath = $this->localBasePath . '/' . $dataPath;
+               $localDataPath = $this->getLocalPath( $dataPath );
 
                if ( !file_exists( $localDataPath ) ) {
                        return false;
@@ -127,7 +130,15 @@ class ResourceLoaderOOUIImageModule extends ResourceLoaderImageModule {
                // Expand the paths to images (since they are relative to the JSON file that defines them, not
                // our base directory)
                $fixPath = function ( &$path ) use ( $dataPath ) {
-                       $path = dirname( $dataPath ) . '/' . $path;
+                       if ( $dataPath instanceof ResourceLoaderFilePath ) {
+                               $path = new ResourceLoaderFilePath(
+                                       dirname( $dataPath->getPath() ) . '/' . $path,
+                                       $dataPath->getLocalBasePath(),
+                                       $dataPath->getRemoteBasePath()
+                               );
+                       } else {
+                               $path = dirname( $dataPath ) . '/' . $path;
+                       }
                };
                array_walk( $data['images'], function ( &$value ) use ( $fixPath ) {
                        if ( is_string( $value['file'] ) ) {
index 899fbbd..fdcc213 100644 (file)
@@ -82,7 +82,7 @@ trait ResourceLoaderOOUIModule {
         * Return a map of theme names to lists of paths from which a given theme should be loaded.
         *
         * Keys are theme names, values are associative arrays. Keys of the inner array are 'scripts',
-        * 'styles', or 'images', and values are string paths.
+        * 'styles', or 'images', and values are paths. Paths may be strings or ResourceLoaderFilePaths.
         *
         * Additionally, the string '{module}' in paths represents the name of the module to load.
         *
@@ -90,29 +90,57 @@ trait ResourceLoaderOOUIModule {
         */
        protected static function getThemePaths() {
                $themePaths = self::$builtinThemePaths;
+               $themePaths += ExtensionRegistry::getInstance()->getAttribute( 'OOUIThemePaths' );
+
+               list( $defaultLocalBasePath, $defaultRemoteBasePath ) =
+                       ResourceLoaderFileModule::extractBasePaths();
+
+               // Allow custom themes' paths to be relative to the skin/extension that defines them,
+               // like with ResourceModuleSkinStyles
+               foreach ( $themePaths as $theme => &$paths ) {
+                       list( $localBasePath, $remoteBasePath ) =
+                               ResourceLoaderFileModule::extractBasePaths( $paths );
+                       if ( $localBasePath !== $defaultLocalBasePath || $remoteBasePath !== $defaultRemoteBasePath ) {
+                               foreach ( $paths as &$path ) {
+                                       $path = new ResourceLoaderFilePath( $path, $localBasePath, $remoteBasePath );
+                               }
+                       }
+               }
+
                return $themePaths;
        }
 
        /**
         * Return a path to load given module of given theme from.
         *
+        * The file at this path may not exist. This should be handled by the caller (throwing an error or
+        * falling back to default theme).
+        *
         * @param string $theme OOUI theme name, for example 'WikimediaUI' or 'Apex'
         * @param string $kind Kind of the module: 'scripts', 'styles', or 'images'
         * @param string $module Module name, for valid values see $knownScriptsModules,
         *     $knownStylesModules, $knownImagesModules
-        * @return string
+        * @return string|ResourceLoaderFilePath
         */
        protected function getThemePath( $theme, $kind, $module ) {
                $paths = self::getThemePaths();
                $path = $paths[$theme][$kind];
-               $path = str_replace( '{module}', $module, $path );
+               if ( $path instanceof ResourceLoaderFilePath ) {
+                       $path = new ResourceLoaderFilePath(
+                               str_replace( '{module}', $module, $path->getPath() ),
+                               $path->getLocalBasePath(),
+                               $path->getRemoteBasePath()
+                       );
+               } else {
+                       $path = str_replace( '{module}', $module, $path );
+               }
                return $path;
        }
 
        /**
         * @param string $theme See getThemePath()
         * @param string $module See getThemePath()
-        * @return string
+        * @return string|ResourceLoaderFilePath
         */
        protected function getThemeScriptsPath( $theme, $module ) {
                if ( !in_array( $module, self::$knownScriptsModules ) ) {
@@ -124,7 +152,7 @@ trait ResourceLoaderOOUIModule {
        /**
         * @param string $theme See getThemePath()
         * @param string $module See getThemePath()
-        * @return string
+        * @return string|ResourceLoaderFilePath
         */
        protected function getThemeStylesPath( $theme, $module ) {
                if ( !in_array( $module, self::$knownStylesModules ) ) {
@@ -136,7 +164,7 @@ trait ResourceLoaderOOUIModule {
        /**
         * @param string $theme See getThemePath()
         * @param string $module See getThemePath()
-        * @return string
+        * @return string|ResourceLoaderFilePath
         */
        protected function getThemeImagesPath( $theme, $module ) {
                if ( !in_array( $module, self::$knownImagesModules ) ) {
diff --git a/tests/phpunit/data/rlfilepath/eye.svg b/tests/phpunit/data/rlfilepath/eye.svg
new file mode 100644 (file)
index 0000000..be0c4e6
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>eye</title><path d="M10 7.5a2.5 2.5 0 1 0 2.5 2.5A2.5 2.5 0 0 0 10 7.5zm0 7a4.5 4.5 0 1 1 4.5-4.5 4.5 4.5 0 0 1-4.5 4.5zM10 3C3 3 0 10 0 10s3 7 10 7 10-7 10-7-3-7-10-7z"/></svg>
\ No newline at end of file
diff --git a/tests/phpunit/data/rlfilepath/flag-ltr.svg b/tests/phpunit/data/rlfilepath/flag-ltr.svg
new file mode 100644 (file)
index 0000000..d19bed5
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>flag</title><path d="M17 6L3 1v18h2v-6.87L17 6z"/></svg>
\ No newline at end of file
diff --git a/tests/phpunit/data/rlfilepath/flag-rtl.svg b/tests/phpunit/data/rlfilepath/flag-rtl.svg
new file mode 100644 (file)
index 0000000..a58bb92
--- /dev/null
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><title>flag</title><path d="M3 6l14-5v18h-2v-6.87L3 6z"/></svg>
\ No newline at end of file
diff --git a/tests/phpunit/data/rlfilepath/script.js b/tests/phpunit/data/rlfilepath/script.js
new file mode 100644 (file)
index 0000000..f5d7aa5
--- /dev/null
@@ -0,0 +1 @@
+mw.test();
diff --git a/tests/phpunit/data/rlfilepath/skinStyle.css b/tests/phpunit/data/rlfilepath/skinStyle.css
new file mode 100644 (file)
index 0000000..575d19f
--- /dev/null
@@ -0,0 +1,3 @@
+body {
+       color: red;
+}
diff --git a/tests/phpunit/data/rlfilepath/style.css b/tests/phpunit/data/rlfilepath/style.css
new file mode 100644 (file)
index 0000000..e87cc6a
--- /dev/null
@@ -0,0 +1,3 @@
+body {
+       color: black;
+}
diff --git a/tests/phpunit/data/rlfilepath/template.html b/tests/phpunit/data/rlfilepath/template.html
new file mode 100644 (file)
index 0000000..7c89b54
--- /dev/null
@@ -0,0 +1 @@
+<div></div>
index 5be0f9b..a9e7fcf 100644 (file)
@@ -265,6 +265,47 @@ class ResourceLoaderFileModuleTest extends ResourceLoaderTestCase {
                );
        }
 
+       /**
+        * Test reading files from elsewhere than localBasePath using ResourceLoaderFilePath.
+        *
+        * This mimics modules modified by skins using 'ResourceModuleSkinStyles' and 'OOUIThemePaths'
+        * skin attributes.
+        *
+        * @covers ResourceLoaderFilePath::getLocalBasePath
+        * @covers ResourceLoaderFilePath::getRemoteBasePath
+        */
+       public function testResourceLoaderFilePath() {
+               $basePath = __DIR__ . '/../../data/blahblah';
+               $filePath = __DIR__ . '/../../data/rlfilepath';
+               $testModule = new ResourceLoaderFileModule( [
+                       'localBasePath' => $basePath,
+                       'remoteBasePath' => 'blahblah',
+                       'styles' => new ResourceLoaderFilePath( 'style.css', $filePath, 'rlfilepath' ),
+                       'skinStyles' => [
+                               'vector' => new ResourceLoaderFilePath( 'skinStyle.css', $filePath, 'rlfilepath' ),
+                       ],
+                       'scripts' => new ResourceLoaderFilePath( 'script.js', $filePath, 'rlfilepath' ),
+                       'templates' => new ResourceLoaderFilePath( 'template.html', $filePath, 'rlfilepath' ),
+               ] );
+               $expectedModule = new ResourceLoaderFileModule( [
+                       'localBasePath' => $filePath,
+                       'remoteBasePath' => 'rlfilepath',
+                       'styles' => 'style.css',
+                       'skinStyles' => [
+                               'vector' => 'skinStyle.css',
+                       ],
+                       'scripts' => 'script.js',
+                       'templates' => 'template.html',
+               ] );
+
+               $context = $this->getResourceLoaderContext();
+               $this->assertEquals(
+                       $expectedModule->getModuleContent( $context ),
+                       $testModule->getModuleContent( $context ),
+                       "Using ResourceLoaderFilePath works correctly"
+               );
+       }
+
        public static function providerGetTemplates() {
                $modules = self::getModules();
 
index 3f5704d..dad9f1e 100644 (file)
@@ -144,6 +144,55 @@ class ResourceLoaderImageModuleTest extends ResourceLoaderTestCase {
                ];
        }
 
+       /**
+        * Test reading files from elsewhere than localBasePath using ResourceLoaderFilePath.
+        *
+        * This mimics modules modified by skins using 'ResourceModuleSkinStyles' and 'OOUIThemePaths'
+        * skin attributes.
+        *
+        * @covers ResourceLoaderFilePath::getLocalBasePath
+        * @covers ResourceLoaderFilePath::getRemoteBasePath
+        */
+       public function testResourceLoaderFilePath() {
+               $basePath = __DIR__ . '/../../data/blahblah';
+               $filePath = __DIR__ . '/../../data/rlfilepath';
+               $testModule = new ResourceLoaderImageModule( [
+                       'localBasePath' => $basePath,
+                       'remoteBasePath' => 'blahblah',
+                       'prefix' => 'foo',
+                       'images' => [
+                               'eye' => new ResourceLoaderFilePath( 'eye.svg', $filePath, 'rlfilepath' ),
+                               'flag' => [
+                                       'file' => [
+                                               'ltr' => new ResourceLoaderFilePath( 'flag-ltr.svg', $filePath, 'rlfilepath' ),
+                                               'rtl' => new ResourceLoaderFilePath( 'flag-rtl.svg', $filePath, 'rlfilepath' ),
+                                       ],
+                               ],
+                       ],
+               ] );
+               $expectedModule = new ResourceLoaderImageModule( [
+                       'localBasePath' => $filePath,
+                       'remoteBasePath' => 'rlfilepath',
+                       'prefix' => 'foo',
+                       'images' => [
+                               'eye' => 'eye.svg',
+                               'flag' => [
+                                       'file' => [
+                                               'ltr' => 'flag-ltr.svg',
+                                               'rtl' => 'flag-rtl.svg',
+                                       ],
+                               ],
+                       ],
+               ] );
+
+               $context = $this->getResourceLoaderContext();
+               $this->assertEquals(
+                       $expectedModule->getModuleContent( $context ),
+                       $testModule->getModuleContent( $context ),
+                       "Using ResourceLoaderFilePath works correctly"
+               );
+       }
+
        /**
         * @dataProvider providerGetModules
         * @covers ResourceLoaderImageModule::getStyles