X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Flayout_builder%2Ftests%2Fsrc%2FKernel%2FLayoutBuilderCompatibilityTestBase.php;fp=web%2Fcore%2Fmodules%2Flayout_builder%2Ftests%2Fsrc%2FKernel%2FLayoutBuilderCompatibilityTestBase.php;h=72ee01ac60802b77beebe1385244459c67117037;hp=d5a4cd0b8a8fd7c937b39d8eccf02f95b5433d20;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/web/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php b/web/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php index d5a4cd0b8..72ee01ac6 100644 --- a/web/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php +++ b/web/core/modules/layout_builder/tests/src/Kernel/LayoutBuilderCompatibilityTestBase.php @@ -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());