You are here

public function SectionStorageTestBase::testClone in Drupal 8

Tests __clone().

File

core/modules/layout_builder/tests/src/Kernel/SectionStorageTestBase.php, line 183

Class

SectionStorageTestBase
Provides a base class for testing implementations of section storage.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

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