diff --git a/core/modules/config/src/Tests/ConfigImporterTest.php b/core/modules/config/src/Tests/ConfigImporterTest.php index e393f10..666e68f 100644 --- a/core/modules/config/src/Tests/ConfigImporterTest.php +++ b/core/modules/config/src/Tests/ConfigImporterTest.php @@ -548,7 +548,8 @@ function testIsInstallable() { * @see \Drupal\Core\Config\ConfigImporter::createExtensionChangelist() */ public function testUnmetDependency() { - $staging = \Drupal::service('config.storage.staging'); + $storage = $this->container->get('config.storage'); + $staging = $this->container->get('config.storage.staging'); // Test an unknown configuration owner. $staging->write('unknown.config', ['test' => 'test']); @@ -562,6 +563,14 @@ public function testUnmetDependency() { $config_entity_data['dependencies'] = ['config' => ['unknown']]; $staging->write('config_test.dynamic.dotted.config', $config_entity_data); + // Make an active config depend on something that is missing in staging. + // The whole configuration needs to be consistent not only the updated one. + $config_entity_data['dependencies'] = []; + $storage->write('config_test.dynamic.dotted.deleted', $config_entity_data); + $config_entity_data['dependencies'] = ['config' => ['config_test.dynamic.dotted.deleted']]; + $storage->write('config_test.dynamic.dotted.existing', $config_entity_data); + $staging->write('config_test.dynamic.dotted.existing', $config_entity_data); + // Add a module and a theme that do not exist. $extensions = $staging->read('core.extension'); $extensions['module']['unknown_module'] = 0; @@ -578,6 +587,7 @@ public function testUnmetDependency() { 'Unable to install module unknown_module since it does not exist.', 'Unable to install theme unknown_theme since it does not exist.', 'Configuration config_test.dynamic.dotted.config depends on configuration that will not exist after import.', + 'Configuration config_test.dynamic.dotted.existing depends on configuration that will not exist after import.', 'Configuration config_test.dynamic.dotted.module depends on a module that will not be installed after import.', 'Configuration config_test.dynamic.dotted.theme depends on a theme that will not be installed after import.', 'Configuration unknown.config depends on the unknown extension that will not be installed after import.'