diff --git a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php index fdd63a95b3a..8a6a9308fca 100644 --- a/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php +++ b/core/tests/Drupal/FunctionalTests/Installer/InstallerExistingConfigTestBase.php @@ -4,6 +4,7 @@ namespace Drupal\FunctionalTests\Installer; use Drupal\Component\Serialization\Yaml; use Drupal\Core\Archiver\ArchiveTar; +use Drupal\Core\Database\Database; use Drupal\Core\Installer\Form\SelectProfileForm; /** @@ -69,6 +70,18 @@ abstract class InstallerExistingConfigTestBase extends InstallerTestBase { } $archiver->extractList($files, $config_sync_directory); } + + // Add the module that is providing the database driver to the list of + // modules that can not be uninstalled in the core.extension configuration. + if (file_exists($config_sync_directory . '/core.extension.yml')) { + $core_extension = Yaml::decode(file_get_contents($config_sync_directory . '/core.extension.yml')); + $module = Database::getConnection()->getProvider(); + if ($module !== 'core') { + $core_extension['module'][$module] = 0; + $core_extension['module'] = module_config_sort($core_extension['module']); + file_put_contents($config_sync_directory . '/core.extension.yml', Yaml::encode($core_extension)); + } + } } /**