$this->
assertTrue($field_storage->
hasdata(), 'There are entities with deleted field data.'
);
$this->
assertEquals(6,
$this->storage->
countFieldData($field_storage), 'There are 6 entities with deleted field data.'
);
$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]);
$cardinality =
$this->fieldTestData->field_storage_2->
getCardinality();
$this->
assertFalse($this->fieldTestData->field_storage_2->
hasData(), 'There are no entities with field data.'
);
$this->
assertSame(0,
$this->storageRev->
countFieldData($this->fieldTestData->field_storage_2
), 'There are 0 entities with field data.'
);
// Create 1 entity with the field.
$entity =
clone($entity_init);
$values =
$this->
_generateTestFieldValues($this->fieldTestData->field_storage_2->
getCardinality());
$entity->
{$this->fieldTestData->field_name_2
} =
$values;
$entity->
setNewRevision();
$entity->
save();
$first_revision =
$entity->
getRevisionId();
$this->
assertTrue($this->fieldTestData->field_storage_2->
hasData(), 'There are entities with field data.'
);