ModuleInstaller::install() parameter $enable_dependencies doesn't work in kernel tests

Created on 23 December 2017, over 7 years ago
Updated 14 September 2024, 8 months ago

According to the documentation, the parameter $enable_dependencies in ModuleInstaller::install() is:

   * @param bool $enable_dependencies
   *   (optional) If TRUE, dependencies will automatically be installed in the
   *   correct order. This incurs a significant performance cost, so use FALSE
   *   if you know $module_list is already complete.

However, passing FALSE to this has weird effects.

For example, consider the test NodeImportCreateTest. This enables a test module, node_test_config, which has no dependencies. So you'd think that passing TRUE or FALSE to $enable_dependencies would make no difference.

However, when you pass FALSE, the test fails:

Drupal\Tests\node\Kernel\Config\NodeImportCreateTest::testImportCreateDefault
The following module is missing from the file system: node_test_config

/Users/joachim/Sites/8-drupal/core/includes/bootstrap.inc:248
/Users/joachim/Sites/8-drupal/core/includes/bootstrap.inc:271
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/Config/ConfigInstaller.php:672
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/Config/ConfigInstaller.php:654
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/Config/ConfigInstaller.php:453
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/ProxyClass/Config/ConfigInstaller.php:132
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/Extension/ModuleInstaller.php:145
/Users/joachim/Sites/8-drupal/core/lib/Drupal/Core/ProxyClass/Extension/ModuleInstaller.php:83
/Users/joachim/Sites/8-drupal/core/modules/node/tests/src/Kernel/Config/NodeImportCreateTest.php
🐛 Bug report
Status

Closed: outdated

Version

11.0 🔥

Component
Extension 

Last updated 4 days ago

No maintainer
Created by

🇬🇧United Kingdom joachim

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇳🇿New Zealand quietone

    Tested on a fresh install of 11.x , with the changes in the patch applied and there are no errors. This must have been fixed sometime in the past 7 years.

    Therefore, closing as outdated.

Production build 0.71.5 2024