// 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();
if (empty($all_names)) { // Module has an empty config directory. For example it might contain a
// schema directory.
return;
} $this->
assertNotEmpty($all_names);
$module_config_dependencies = \Drupal::
service('config.manager'
)->
findConfigEntityDependencies('module',
[$module]);
// Look up each default configuration object name in the active
// configuration, and if it exists, remove it from the stack.
$names =
$module_file_storage->
listAll();
foreach ($names as $key =>
$name) { if ($this->
config($name)->
get()) { unset($names[$key]);
} // All configuration in a module's config/install directory should depend
// on the module as it must be removed on uninstall or the module will not
// be re-installable.
$this->
assertTrue(str_starts_with($name,
$module . '.'
) ||
isset($module_config_dependencies[$name]), "Configuration
$name provided by
$module in its config/install directory does not depend on it."
);
}