You are here

protected function MediaMigrationAssertionsBaseTrait::assertMediaRemoteVideoDisplayModes in Media Migration 8

Tests media remote_video's default form and view mode configuration.

1 call to MediaMigrationAssertionsBaseTrait::assertMediaRemoteVideoDisplayModes()
MediaMigrationFormatterWidgetTest::assertMediaTypeDisplayModes in tests/src/Kernel/Migrate/MediaMigrationFormatterWidgetTest.php
Tests display configuration of the migrated media types.

File

tests/src/Traits/MediaMigrationAssertionsBaseTrait.php, line 617

Class

MediaMigrationAssertionsBaseTrait
Trait for media migration tests.

Namespace

Drupal\Tests\media_migration\Traits

Code

protected function assertMediaRemoteVideoDisplayModes() {
  $entity_form_display = $this->container
    ->get('entity_type.manager')
    ->getStorage('entity_form_display')
    ->load(implode('.', [
    'media',
    'remote_video',
    'default',
  ]));
  $this
    ->assertEquals([
    'status' => TRUE,
    'id' => 'media.remote_video.default',
    'targetEntityType' => 'media',
    'bundle' => 'remote_video',
    'mode' => 'default',
    'content' => [
      'created' => [
        'type' => 'datetime_timestamp',
        'weight' => 10,
        'region' => 'content',
        'settings' => [],
        'third_party_settings' => [],
      ],
      'field_media_oembed_video' => [
        'type' => 'string_textfield',
        'weight' => 0,
        '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' => [
      'name' => TRUE,
    ],
  ], $this
    ->getImportantEntityProperties($entity_form_display));
  $entity_view_display = $this->container
    ->get('entity_type.manager')
    ->getStorage('entity_view_display')
    ->load(implode('.', [
    'media',
    'remote_video',
    'default',
  ]));
  $this
    ->assertEquals([
    'status' => TRUE,
    'id' => 'media.remote_video.default',
    'targetEntityType' => 'media',
    'bundle' => 'remote_video',
    'mode' => 'default',
    'content' => [
      'field_media_oembed_video' => [
        'type' => 'oembed',
        'weight' => 0,
        'settings' => [
          'max_width' => 0,
          'max_height' => 0,
        ],
        'third_party_settings' => [],
        'region' => 'content',
        'label' => 'visually_hidden',
      ],
    ],
    'hidden' => [
      'created' => TRUE,
      'name' => TRUE,
      'thumbnail' => TRUE,
      'uid' => TRUE,
    ],
  ], $this
    ->getImportantEntityProperties($entity_view_display));
}