Skip to content
Snippets Groups Projects
Commit 0113f3d7 authored by Dries Buytaert's avatar Dries Buytaert
Browse files

Issue #1850158 by sun, tim.plunkett, xjm: bugged assumption in...

Issue #1850158 by sun, tim.plunkett, xjm: bugged assumption in ModuleTestBase::assertModuleConfig().
parent b54a659d
Branches
Tags
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -99,13 +99,18 @@ function assertModuleConfig($module) {
return;
}
$module_file_storage = new FileStorage($module_config_dir);
$names = $module_file_storage->listAll($module . '.');
// Verify that the config directory is not empty.
$this->assertTrue($names);
// Verify that the module's default config directory is not empty and
// contains default configuration files (instead of something else).
$all_names = $module_file_storage->listAll();
$this->assertTrue($all_names);
// Look up each default configuration object name in the active
// configuration, and if it exists, remove it from the stack.
// Only default config that belongs to $module is guaranteed to exist; any
// other default config depends on whether other modules are enabled. Thus,
// list all default config once more, but filtered by $module.
$names = $module_file_storage->listAll($module . '.');
foreach ($names as $key => $name) {
if (config($name)->get()) {
unset($names[$key]);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment