You are here

protected function FarmEntityCacheTestTrait::getEntityCacheId in farmOS 2.x

Helper method to build the entity test cache ID.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity to cache data for.

Return value

string The entity's test cache ID.

2 calls to FarmEntityCacheTestTrait::getEntityCacheId()
FarmEntityCacheTestTrait::assertEntityTestCache in modules/core/test/tests/src/Kernel/FarmEntityCacheTestTrait.php
Assert that a cache value dependent on an entity's cache tags exists.
FarmEntityCacheTestTrait::populateEntityTestCache in modules/core/test/tests/src/Kernel/FarmEntityCacheTestTrait.php
Populate a cache value that is dependent on an entity's cache tags.

File

modules/core/test/tests/src/Kernel/FarmEntityCacheTestTrait.php, line 51

Class

FarmEntityCacheTestTrait
Trait for testing invalidation of entity cache tags.

Namespace

Drupal\Tests\farm_test\Kernel

Code

protected function getEntityCacheId(EntityInterface $entity) : string {
  $entity_type = $entity
    ->getEntityTypeId();
  $entity_id = $entity
    ->id();
  return "farm_entity_cache_test:{$entity_type}:{$entity_id}";
}