You are here

protected function MediaMigrationAssertionsBaseTrait::assertMediaVideoDisplayModes in Media Migration 8

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

2 calls to MediaMigrationAssertionsBaseTrait::assertMediaVideoDisplayModes()
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 508

Class

MediaMigrationAssertionsBaseTrait
Trait for media migration tests.

Namespace

Drupal\Tests\media_migration\Traits

Code

protected function assertMediaVideoDisplayModes() {
  $entity_form_display = $this->container
    ->get('entity_type.manager')
    ->getStorage('entity_form_display')
    ->load(implode('.', [
    'media',
    'video',
    'default',
  ]));
  $this
    ->assertEquals([
    'status' => TRUE,
    'id' => 'media.video.default',
    'targetEntityType' => 'media',
    'bundle' => 'video',
    'mode' => 'default',
    'content' => [
      'created' => [
        'type' => 'datetime_timestamp',
        'weight' => 10,
        'region' => 'content',
        'settings' => [],
        'third_party_settings' => [],
      ],
      'field_media_video_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',
    'video',
    'default',
  ]));
  $this
    ->assertEquals([
    'status' => TRUE,
    'id' => 'media.video.default',
    'targetEntityType' => 'media',
    'bundle' => 'video',
    'mode' => 'default',
    'content' => [
      'field_media_video_file' => [
        'type' => 'file_video',
        'weight' => 0,
        'settings' => [
          'muted' => FALSE,
          'width' => 640,
          'height' => 480,
          '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));
}