'enabled' => TRUE,
'label' => 'View Mode 1',
])->
setSyncing(TRUE
)->
save();
EntityViewMode::
create([ 'id' => 'media.view_mode_2',
'targetEntityType' => 'media',
'status' => TRUE,
'enabled' => TRUE,
'label' => 'View Mode 2',
])->
setSyncing(TRUE
)->
save();
$filter_format = FilterFormat::
load('basic_html_with_media_embed_view_mode_enabled_two_view_modes_configured'
);
$filter_format->
setFilterConfig('media_embed',
[ 'status' => TRUE,
'settings' =>
[ 'default_view_mode' => 'view_mode_1',
'allowed_media_types' =>
[],
'allowed_view_modes' =>
[ 'view_mode_1' => 'view_mode_1',
'view_mode_2' => 'view_mode_2',
],
],
])->
setSyncing(TRUE
)->
save();