$this->
doTestCreateMediaType($media_type_id, 'oembed:video',
$provided_fields);
// Create custom fields for the media type to store metadata attributes.
$fields =
[ 'field_string_width' => 'string',
'field_string_height' => 'string',
'field_string_author_name' => 'string',
];
$this->
createMediaTypeFields($fields,
$media_type_id);
// Hide the name field widget to test default name generation.
$this->
hideMediaTypeFieldWidget('name',
$media_type_id);
$this->
drupalGet("admin/structure/media/manage/
$media_type_id"
);
// Only accept Vimeo videos.
$page->
checkField("source_configuration[providers][Vimeo]"
);
$assert_session->
selectExists('field_map[width]'
)->
setValue('field_string_width'
);
$assert_session->
selectExists('field_map[height]'
)->
setValue('field_string_height'
);
$assert_session->
selectExists('field_map[author_name]'
)->
setValue('field_string_author_name'
);
$assert_session->
buttonExists('Save'
)->
press();
// Configure the iframe to be narrower than the actual video, so we can
// verify that the video scales correctly.