X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=tests%2Fphpunit%2Fstructure%2FResourcesTest.php;h=d31779d0badacdcab1496da9a77237fd88ee05b0;hb=1b13888ed6bd09731f10045650714a3392bb55df;hp=2fba76b6885abdb60ce6497558cee2d22eff924e;hpb=49748181dd56ec97e7ba7c13e684a16abceb3cc0;p=lhc%2Fweb%2Fwiklou.git diff --git a/tests/phpunit/structure/ResourcesTest.php b/tests/phpunit/structure/ResourcesTest.php index 2fba76b688..d31779d0ba 100644 --- a/tests/phpunit/structure/ResourcesTest.php +++ b/tests/phpunit/structure/ResourcesTest.php @@ -44,15 +44,24 @@ class ResourcesTest extends MediaWikiTestCase { } /** - * 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 ) {