Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
If a test tries to install configuration files while depending on other module configurations it fails without giving a descriptive error. For example if a module requires views with a menu to run but you forget to install the system configuration (which provides the default menus), the installation of the module configuration fails with a fatal error during dependency calucation.
Proposed resolution
Check in KernelTestBase::installConfig() if required dependencies and their configuration have been installed. If not, give an error. Just like when installing a module normally.
Remaining tasks
User interface changes
None
API changes
None
Comments
Comment #1
BerdirUpdating issue summary a bit.
I've seen this in 3-4 different modules now, always with views + a menu, and it is always very confusing to new developers.
Comment #2
alexpottYes but that's not how
Drupal\simpletest\KernelTestBase::enableModules()
behaves.Comment #13
mondrakeIf it's still relevant, it's no longer for simpletest.
Comment #16
joachim CreditAttribution: joachim at Factorial GmbH commentedFix typo in title so it's easier to find this issue.
Comment #17
joachim CreditAttribution: joachim at Factorial GmbH commentedArg.