Merge "Use the WebRequest::getCheck() shortcut where possible"
[lhc/web/wiklou.git] / includes / registration / ExtensionProcessor.php
index 07fab78..b474ddc 100644 (file)
@@ -107,7 +107,7 @@ class ExtensionProcessor implements Processor {
        ];
 
        /**
-        * Things that are not 'attributes', but are not in
+        * Things that are not 'attributes', and are not in
         * $globalSettings or $creditsAttributes.
         *
         * @var array
@@ -119,6 +119,7 @@ class ExtensionProcessor implements Processor {
                'ResourceFileModulePaths',
                'ResourceModules',
                'ResourceModuleSkinStyles',
+               'QUnitTestModule',
                'ExtensionMessagesFiles',
                'MessagesDirs',
                'type',
@@ -188,7 +189,6 @@ class ExtensionProcessor implements Processor {
         * @param string $path
         * @param array $info
         * @param int $version manifest_version for info
-        * @return array
         */
        public function extractInfo( $path, array $info, $version ) {
                $dir = dirname( $path );
@@ -394,6 +394,19 @@ class ExtensionProcessor implements Processor {
                                }
                        }
                }
+
+               if ( isset( $info['QUnitTestModule'] ) ) {
+                       $data = $info['QUnitTestModule'];
+                       if ( isset( $data['localBasePath'] ) ) {
+                               if ( $data['localBasePath'] === '' ) {
+                                       // Avoid double slashes (e.g. /extensions/Example//path)
+                                       $data['localBasePath'] = $dir;
+                               } else {
+                                       $data['localBasePath'] = "$dir/{$data['localBasePath']}";
+                               }
+                       }
+                       $this->attributes['QUnitTestModules']["test.{$info['name']}"] = $data;
+               }
        }
 
        protected function extractExtensionMessagesFiles( $dir, array $info ) {