$source_field_id = 'field_media_file';
$provided_fields =
[ File::METADATA_ATTRIBUTE_NAME,
File::METADATA_ATTRIBUTE_SIZE,
File::METADATA_ATTRIBUTE_MIME,
];
$session =
$this->
getSession();
$page =
$session->
getPage();
$assert_session =
$this->
assertSession();
$this->
doTestCreateMediaType($media_type_id, 'file',
$provided_fields);
// Create custom fields for the media type to store metadata attributes.
$fields =
[ 'field_string_file_size' => 'string',
'field_string_mime_type' => 'string',
];
$this->
createMediaTypeFields($fields,
$media_type_id);
// Hide the name field widget to test default name generation.
$this->
hideMediaTypeFieldWidget('name',
$media_type_id);