protected function MediaMigrationAssertionsBaseTrait::assertMediaAudioDisplayModes in Media Migration 8
Tests media audio's default form and view mode configuration.
2 calls to MediaMigrationAssertionsBaseTrait::assertMediaAudioDisplayModes()
- MediaMigrationFormatterWidgetTest::assertMediaTypeDisplayModes in tests/
src/ Kernel/ Migrate/ MediaMigrationFormatterWidgetTest.php - Tests display configuration of the migrated media types.
- MediaMigrationPlainFormatterWidgetTest::assertMediaTypeDisplayModes in tests/
src/ Kernel/ Migrate/ MediaMigrationPlainFormatterWidgetTest.php - Tests display configuration of the migrated media types.
File
- tests/
src/ Traits/ MediaMigrationAssertionsBaseTrait.php, line 164
Class
- MediaMigrationAssertionsBaseTrait
- Trait for media migration tests.
Namespace
Drupal\Tests\media_migration\TraitsCode
protected function assertMediaAudioDisplayModes() {
$entity_form_display = $this->container
->get('entity_type.manager')
->getStorage('entity_form_display')
->load(implode('.', [
'media',
'audio',
'default',
]));
$this
->assertEquals([
'status' => TRUE,
'id' => 'media.audio.default',
'targetEntityType' => 'media',
'bundle' => 'audio',
'mode' => 'default',
'content' => [
'created' => [
'type' => 'datetime_timestamp',
'weight' => 10,
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
],
'field_media_audio_file' => [
'type' => 'file_generic',
'weight' => 0,
'settings' => [
'progress_indicator' => 'throbber',
],
'third_party_settings' => [],
'region' => 'content',
],
'name' => [
'type' => 'string_textfield',
'weight' => -5,
'settings' => [
'size' => 60,
'placeholder' => '',
],
'third_party_settings' => [],
'region' => 'content',
],
'status' => [
'type' => 'boolean_checkbox',
'weight' => 100,
'settings' => [
'display_label' => TRUE,
],
'third_party_settings' => [],
'region' => 'content',
],
'uid' => [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => [
'match_operator' => 'CONTAINS',
'size' => 60,
'placeholder' => '',
'match_limit' => 10,
],
'third_party_settings' => [],
'region' => 'content',
],
],
'hidden' => [],
], $this
->getImportantEntityProperties($entity_form_display));
$entity_view_display = $this->container
->get('entity_type.manager')
->getStorage('entity_view_display')
->load(implode('.', [
'media',
'audio',
'default',
]));
$this
->assertEquals([
'status' => TRUE,
'id' => 'media.audio.default',
'targetEntityType' => 'media',
'bundle' => 'audio',
'mode' => 'default',
'content' => [
'field_media_audio_file' => [
'type' => 'file_audio',
'weight' => 0,
'settings' => [
'controls' => TRUE,
'autoplay' => FALSE,
'loop' => FALSE,
'multiple_file_display_type' => 'tags',
],
'third_party_settings' => [],
'region' => 'content',
'label' => 'visually_hidden',
],
],
'hidden' => [
'created' => TRUE,
'name' => TRUE,
'thumbnail' => TRUE,
'uid' => TRUE,
],
], $this
->getImportantEntityProperties($entity_view_display));
}