use Drupal\Component\Render\FormattableMarkup;
use Drupal\Core\Logger\RfcLogLevel;
+use Drupal\workspaces\Entity\Workspace;
/**
* Install/uninstall core module and confirm table creation/deletion.
*/
public function testInstallUninstall() {
// Set a variable so that the hook implementations in system_test.module
- // will display messages via drupal_set_message().
+ // will display messages via
+ // \Drupal\Core\Messenger\MessengerInterface::addStatus().
$this->container->get('state')->set('system_test.verbose_module_hooks', TRUE);
// Install and uninstall module_test to ensure hook_preinstall_module and
$this->preUninstallForum();
}
+ // Delete all workspaces before uninstall.
+ if ($name == 'workspaces') {
+ $workspaces = Workspace::loadMultiple();
+ \Drupal::entityTypeManager()->getStorage('workspace')->delete($workspaces);
+ }
+
$now_installed_list = \Drupal::moduleHandler()->getModuleList();
$added_modules = array_diff(array_keys($now_installed_list), array_keys($was_installed_list));
while ($added_modules) {