Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / layout_builder / tests / src / Kernel / LayoutBuilderCompatibilityTestBase.php
index d5a4cd0b8a8fd7c937b39d8eccf02f95b5433d20..72ee01ac60802b77beebe1385244459c67117037 100644 (file)
@@ -23,7 +23,7 @@ abstract class LayoutBuilderCompatibilityTestBase extends EntityKernelTestBase {
   /**
    * The entity view display.
    *
-   * @var \Drupal\field_layout\Display\EntityDisplayWithLayoutInterface
+   * @var \Drupal\layout_builder\Entity\LayoutEntityDisplayInterface
    */
   protected $display;
 
@@ -86,13 +86,21 @@ abstract class LayoutBuilderCompatibilityTestBase extends EntityKernelTestBase {
   /**
    * Installs the Layout Builder.
    *
-   * Also configures and reloads the entity display, and reloads the entity.
+   * Also configures and reloads the entity display.
    */
   protected function installLayoutBuilder() {
     $this->container->get('module_installer')->install(['layout_builder']);
     $this->refreshServices();
 
     $this->display = $this->reloadEntity($this->display);
+    $this->display->enableLayoutBuilder()->save();
+    $this->entity = $this->reloadEntity($this->entity);
+  }
+
+  /**
+   * Enables overrides for the display and reloads the entity.
+   */
+  protected function enableOverrides() {
     $this->display->setOverridable()->save();
     $this->entity = $this->reloadEntity($this->entity);
   }
@@ -104,9 +112,6 @@ abstract class LayoutBuilderCompatibilityTestBase extends EntityKernelTestBase {
    *   The entity to render.
    * @param array $attributes
    *   An array of field attributes to assert.
-   *
-   * @return string
-   *   The rendered string output (typically HTML).
    */
   protected function assertFieldAttributes(EntityInterface $entity, array $attributes) {
     $view_builder = $this->container->get('entity_type.manager')->getViewBuilder($entity->getEntityTypeId());