X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Ftests%2Fsrc%2FFunctional%2FModule%2FInstallUninstallTest.php;h=9ca44078012f912e095e985a7eee411f520ff0e2;hb=1c1cb0980bfa6caf0c24cce671b6bb541dc87583;hp=4d8f30d65c7fd582137b89778da8bbd2cd88c6e3;hpb=af6d1fb995500ae68849458ee10d66abbdcfb252;p=yaffs-website diff --git a/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php b/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php index 4d8f30d65..9ca440780 100644 --- a/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php +++ b/web/core/modules/system/tests/src/Functional/Module/InstallUninstallTest.php @@ -4,6 +4,7 @@ namespace Drupal\Tests\system\Functional\Module; use Drupal\Component\Render\FormattableMarkup; use Drupal\Core\Logger\RfcLogLevel; +use Drupal\workspaces\Entity\Workspace; /** * Install/uninstall core module and confirm table creation/deletion. @@ -22,7 +23,8 @@ class InstallUninstallTest extends ModuleTestBase { */ 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 @@ -147,6 +149,12 @@ class InstallUninstallTest extends ModuleTestBase { $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) {