ResourceLoader: Change $module by ref instead of resetting the key
authorTimo Tijhof <ttijhof@wikimedia.org>
Tue, 2 Apr 2013 20:31:20 +0000 (22:31 +0200)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 2 Apr 2013 20:34:00 +0000 (20:34 +0000)
Change-Id: I8590352b52ecf51def21a9c52af85aba0f050ff8

includes/resourceloader/ResourceLoader.php

index 589a354..9abd1fa 100644 (file)
@@ -286,12 +286,12 @@ class ResourceLoader {
 
                // Add the testrunner (which configures QUnit) to the dependencies.
                // Since it must be ready before any of the test suites are executed.
-               foreach( $testModules['qunit'] as $moduleName => $moduleProps ) {
+               foreach( $testModules['qunit'] as &$module ) {
                        // Make sure all test modules are top-loading so that when QUnit starts
                        // on document-ready, it will run once and finish. If some tests arrive
                        // later (possibly after QUnit has already finished) they will be ignored.
-                       $testModules['qunit'][$moduleName]['position'] = 'top';
-                       $testModules['qunit'][$moduleName]['dependencies'][] = 'mediawiki.tests.qunit.testrunner';
+                       $module['position'] = 'top';
+                       $module['dependencies'][] = 'mediawiki.tests.qunit.testrunner';
                }
 
                foreach( $testModules as $id => $names ) {