You are here

public function SectionListTestBase::testClone in Drupal 9

Same name and namespace in other branches
  1. 10 core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php \Drupal\Tests\layout_builder\Kernel\SectionListTestBase::testClone()

Tests __clone().

File

core/modules/layout_builder/tests/src/Kernel/SectionListTestBase.php, line 181

Class

SectionListTestBase
Provides a base class for testing implementations of a section list.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testClone() {
  $this
    ->assertSame([
    'setting_1' => 'Default',
  ], $this->sectionList
    ->getSection(0)
    ->getLayoutSettings());
  $new_section_storage = clone $this->sectionList;
  $new_section_storage
    ->getSection(0)
    ->setLayoutSettings([
    'asdf' => 'qwer',
  ]);
  $this
    ->assertSame([
    'setting_1' => 'Default',
  ], $this->sectionList
    ->getSection(0)
    ->getLayoutSettings());
}