You are here

public function OverridesSectionStorageTest::testGetTempstoreKey in Drupal 10

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

@covers ::getTempstoreKey

File

core/modules/layout_builder/tests/src/Kernel/OverridesSectionStorageTest.php, line 223

Class

OverridesSectionStorageTest
@coversDefaultClass \Drupal\layout_builder\Plugin\SectionStorage\OverridesSectionStorage

Namespace

Drupal\Tests\layout_builder\Kernel

Code

public function testGetTempstoreKey() {
  $entity = EntityTest::create();
  $entity
    ->save();
  $this->plugin
    ->setContext('entity', EntityContext::fromEntity($entity));
  $this->plugin
    ->setContext('view_mode', new Context(new ContextDefinition('string'), 'default'));
  $result = $this->plugin
    ->getTempstoreKey();
  $this
    ->assertSame('entity_test.1.default.en', $result);
}