You are here

protected function MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaVideoMediaBundleSourceFieldProperties in Media Migration 8

Checks the properties of the audio media type's source field config.

2 calls to MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaVideoMediaBundleSourceFieldProperties()
MediaMigrationPlainTest::testPlainFileToMediaMigration in tests/src/Kernel/Migrate/MediaMigrationPlainTest.php
Tests the migration of plain file and image fields to media reference.
MigrateMediaFromNonMediaSourceTest::testPlainFileToMediaMigration in tests/src/Functional/MigrateMediaFromNonMediaSourceTest.php
Tests the result of the media migration.

File

tests/src/Traits/MediaMigrationAssertionsForNonMediaSourceTrait.php, line 598

Class

MediaMigrationAssertionsForNonMediaSourceTrait
Trait for non-media source to media migration tests.

Namespace

Drupal\Tests\media_migration\Traits

Code

protected function assertNonMediaToMediaVideoMediaBundleSourceFieldProperties() {
  $field_config = $this->container
    ->get('entity_type.manager')
    ->getStorage('field_config')
    ->load('media.video.field_media_video_file');
  assert($field_config instanceof FieldConfigInterface);
  $this
    ->assertEquals([
    'id' => 'media.video.field_media_video_file',
    'status' => TRUE,
    'field_name' => 'field_media_video_file',
    'entity_type' => 'media',
    'bundle' => 'video',
    'label' => 'Video file',
    'description' => '',
    'required' => TRUE,
    'translatable' => TRUE,
    'default_value' => [],
    'default_value_callback' => '',
    'settings' => [
      'description_field' => TRUE,
      'file_directory' => '[date:custom:Y]-[date:custom:m]',
      'file_extensions' => 'mp4 webm',
      'max_filesize' => '',
      'handler' => 'default:file',
      'handler_settings' => [],
    ],
    'field_type' => 'file',
  ], $this
    ->getImportantEntityProperties($field_config));
}