Overrides ContentEntityTestBase::setUp
public function setUp() : void {
parent::setUp();
// Auto-create fields for testing.
FieldStorageConfig::create([
'entity_type' => $this->entityTypeId,
'field_name' => 'field_file',
'type' => 'file',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
])
->save();
FieldConfig::create([
'entity_type' => $this->entityTypeId,
'field_name' => 'field_file',
'bundle' => $this->entityTypeId,
'label' => 'Test file-field',
'translatable' => TRUE,
])
->save();
// Auto-create fields for testing.
FieldStorageConfig::create([
'entity_type' => $this->entityTypeId,
'field_name' => 'field_file_untranslatable',
'type' => 'file',
'cardinality' => FieldStorageDefinitionInterface::CARDINALITY_UNLIMITED,
])
->save();
FieldConfig::create([
'entity_type' => $this->entityTypeId,
'field_name' => 'field_file_untranslatable',
'bundle' => $this->entityTypeId,
'label' => 'Test file-field',
'translatable' => FALSE,
])
->save();
// Add an image field and make it translatable.
$this
->installEntitySchema('file');
$this
->installSchema('file', array(
'file_usage',
));
}