function DefaultsSectionStorageTest::testGetTempstoreKey

Same name in other branches
  1. 9 core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testGetTempstoreKey()
  2. 8.9.x core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testGetTempstoreKey()
  3. 10 core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php \Drupal\Tests\layout_builder\Kernel\DefaultsSectionStorageTest::testGetTempstoreKey()

@covers ::getTempstoreKey

File

core/modules/layout_builder/tests/src/Kernel/DefaultsSectionStorageTest.php, line 191

Class

DefaultsSectionStorageTest
@coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\DefaultsSectionStorage

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testGetTempstoreKey() : void {
    $display = LayoutBuilderEntityViewDisplay::create([
        'targetEntityType' => 'entity_test',
        'bundle' => 'entity_test',
        'mode' => 'default',
        'status' => TRUE,
    ]);
    $display->save();
    $context = EntityContext::fromEntity($display);
    $this->plugin
        ->setContext('display', $context);
    $result = $this->plugin
        ->getTempstoreKey();
    $this->assertSame('entity_test.entity_test.default', $result);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.