->
setTranslatable(TRUE
) ->
setSetting('max_length', 255
);
// A base field with cardinality > 1
$this->commonBaseFields
['string'
] = BaseFieldDefinition::
create('string'
) ->
setLabel('Strong'
) ->
setTranslatable(TRUE
) ->
setCardinality(2
);
// Set up the basic 'entity_test' entity type. This is used by several
// tests; others customize it and the base fields.
$this->
setUpEntityType($this->baseEntityType,
$this->commonBaseFields
);
} /**
* Mocks an entity type and its base fields.
*
* This works by:
* - inserting the entity type definition into the entity type manager's cache
* - setting the base fields on the ViewsTestEntity class as a static property
* for its baseFieldsDefinitions() method to use.
*
* @param \Drupal\Core\Entity\EntityTypeInterface $definition
* An entity type definition to add to the entity type manager.
* @param \Drupal\Core\Field\BaseFieldDefinition[] $base_fields
* An array of base field definitions
*/