// Non-cacheable entity type.
$entity_type = 'entity_test';
$cid = "values:
$entity_type:" .
$entity_init->
id();
// Check that no initial cache entry is present.
$this->
assertFalse(\Drupal::
cache('entity'
)->
get($cid), 'Non-cached: no initial cache entry'
);
// Save, and check that no cache entry is present.
$entity =
clone($entity_init);
$entity->
{$this->fieldTestData->field_name
}->
setValue($values);
$entity =
$this->
entitySaveReload($entity);
$cid = "values:
$entity_type:" .
$entity->
id();
$this->
assertFalse(\Drupal::
cache('entity'
)->
get($cid), 'Non-cached: no cache entry on insert and load'
);
// Cacheable entity type.
$entity_type = 'entity_test_rev';
$this->
createFieldWithStorage('_2',
$entity_type);
$entity_init =
$this->container->
get('entity_type.manager'
) ->
getStorage($entity_type) ->
create([ 'type' =>
$entity_type,
]);