Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / field_layout / tests / src / Kernel / FieldLayoutUninstallTest.php
diff --git a/web/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php b/web/core/modules/field_layout/tests/src/Kernel/FieldLayoutUninstallTest.php
new file mode 100644 (file)
index 0000000..387e6b2
--- /dev/null
@@ -0,0 +1,29 @@
+<?php
+
+namespace Drupal\Tests\field_layout\Kernel;
+
+use Drupal\Tests\layout_builder\Kernel\LayoutBuilderCompatibilityTestBase;
+
+/**
+ * @group field_layout
+ */
+class FieldLayoutUninstallTest extends LayoutBuilderCompatibilityTestBase {
+
+  /**
+   * Ensures field layout can be uninstalled with layout builder enabled.
+   */
+  public function testFieldLayoutUninstall() {
+    // Setup user schema so user hook uninstall hook doesn't break.
+    $this->installSchema('user', 'users_data');
+
+    // Setup layout builder and same displays.
+    $this->installLayoutBuilder();
+
+    // Ensure install hook can handle displays without a layout.
+    $this->container->get('module_installer')->install(['field_layout']);
+
+    // Ensure uninstall hook can handle displays without a layout.
+    $this->container->get('module_installer')->uninstall(['field_layout']);
+  }
+
+}