Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / workspaces / tests / src / Functional / WorkspacesUninstallTest.php
diff --git a/web/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php b/web/core/modules/workspaces/tests/src/Functional/WorkspacesUninstallTest.php
new file mode 100644 (file)
index 0000000..e652e3f
--- /dev/null
@@ -0,0 +1,41 @@
+<?php
+
+namespace Drupal\Tests\workspaces\Functional;
+
+use Drupal\Tests\BrowserTestBase;
+
+/**
+ * Tests uninstalling the Workspaces module.
+ *
+ * @group workspaces
+ */
+class WorkspacesUninstallTest extends BrowserTestBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  protected $profile = 'standard';
+
+  /**
+   * {@inheritdoc}
+   */
+  public static $modules = ['workspaces'];
+
+  /**
+   * Tests deleting workspace entities and uninstalling Workspaces module.
+   */
+  public function testUninstallingWorkspace() {
+    $this->drupalLogin($this->rootUser);
+    $this->drupalGet('/admin/modules/uninstall');
+    $session = $this->assertSession();
+    $session->linkExists('Remove workspaces');
+    $this->clickLink('Remove workspaces');
+    $session->pageTextContains('Are you sure you want to delete all workspaces?');
+    $this->drupalPostForm('/admin/modules/uninstall/entity/workspace', [], 'Delete all workspaces');
+    $this->drupalPostForm('admin/modules/uninstall', ['uninstall[workspaces]' => TRUE], 'Uninstall');
+    $this->drupalPostForm(NULL, [], 'Uninstall');
+    $session->pageTextContains('The selected modules have been uninstalled.');
+    $session->pageTextNotContains('Workspaces');
+  }
+
+}