Krinkle has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/382021 )

Change subject: phpunit: Include all raw modules in detection of illegal 
dependencies
......................................................................

phpunit: Include all raw modules in detection of illegal dependencies

* Use getStartupModules() instead of hardcoding these two module names.
* Also collect any other module that is registered with raw=>true.

Change-Id: I5f75cc8f99b90f58d76b7e87f068f50f9f608ed0
---
M tests/phpunit/structure/ResourcesTest.php
1 file changed, 12 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/21/382021/1

diff --git a/tests/phpunit/structure/ResourcesTest.php 
b/tests/phpunit/structure/ResourcesTest.php
index 2fba76b..d31779d 100644
--- a/tests/phpunit/structure/ResourcesTest.php
+++ b/tests/phpunit/structure/ResourcesTest.php
@@ -44,15 +44,24 @@
        }
 
        /**
-        * Verify that nothing explicitly depends on the 'jquery' and 
'mediawiki' modules.
-        * They are always loaded, depending on them is unsupported and leads 
to unexpected behaviour.
+        * Verify that nothing explicitly depends on base modules, or other raw 
modules.
+        *
+        * Depending on them is unsupported as they are not registered 
client-side by the startup module.
+        *
         * TODO Modules can dynamically choose dependencies based on context. 
This method does not
         * test such dependencies. The same goes for testMissingDependencies() 
and
         * testUnsatisfiableDependencies().
         */
        public function testIllegalDependencies() {
                $data = self::getAllModules();
-               $illegalDeps = [ 'jquery', 'mediawiki' ];
+
+               $illegalDeps = ResourceLoaderStartupModule::getStartupModules();
+               foreach ( $data['modules'] as $moduleName => $module ) {
+                       if ( $module->isRaw() ) {
+                               $illegalDeps[] = $moduleName;
+                       }
+               }
+               $illegalDeps = array_unique( $illegalDeps );
 
                /** @var ResourceLoaderModule $module */
                foreach ( $data['modules'] as $moduleName => $module ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/382021
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I5f75cc8f99b90f58d76b7e87f068f50f9f608ed0
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to