$this->
assertTrue(isset($modules_to_uninstall['comment'
]), 'The comment module will be disabled'
);
$this->
assertTrue(isset($modules_to_uninstall['file'
]), 'The File module will be disabled'
);
$this->
assertTrue(isset($modules_to_uninstall['editor'
]), 'The Editor module will be disabled'
);
// Uninstall all modules that can be uninstalled.
\Drupal::
service('module_installer'
)->
uninstall(array_keys($modules_to_uninstall));
$this->
assertModules(array_keys($modules_to_uninstall), FALSE
);
foreach ($modules_to_uninstall as $module =>
$info) { $this->
assertNoModuleConfig($module);
$this->
assertModuleTablesDoNotExist($module);
} // Import the configuration thereby re-installing all the modules.
$this->
drupalGet('admin/config/development/configuration'
);
$this->
submitForm([], 'Import all'
);
// Modules have been installed that have services.
$this->
rebuildContainer();
// Check that there are no errors.
$this->
assertSame([],
$this->
configImporter()->
getErrors());