You are here

public function LayoutSectionItemListTest::testEquals in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php \Drupal\Tests\layout_builder\Kernel\LayoutSectionItemListTest::testEquals()

@covers ::equals

File

core/modules/layout_builder/tests/src/Kernel/LayoutSectionItemListTest.php, line 56

Class

LayoutSectionItemListTest
Tests the field type for Layout Sections.

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testEquals() {
  $this->sectionList
    ->getSection(0)
    ->setLayoutSettings([
    'foo' => 1,
  ]);
  $second_section_storage = clone $this->sectionList;
  $this
    ->assertTrue($this->sectionList
    ->equals($second_section_storage));
  $second_section_storage
    ->getSection(0)
    ->setLayoutSettings([
    'foo' => '1',
  ]);
  $this
    ->assertFalse($this->sectionList
    ->equals($second_section_storage));
}