You are here

protected function MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaAudioMediaBundleSourceFieldProperties in Media Migration 8

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

2 calls to MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaAudioMediaBundleSourceFieldProperties()
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 565

Class

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

Namespace

Drupal\Tests\media_migration\Traits

Code

protected function assertNonMediaToMediaAudioMediaBundleSourceFieldProperties() {
  $field_config = $this->container
    ->get('entity_type.manager')
    ->getStorage('field_config')
    ->load('media.audio.field_media_audio_file');
  assert($field_config instanceof FieldConfigInterface);
  $this
    ->assertEquals([
    'id' => 'media.audio.field_media_audio_file',
    'status' => TRUE,
    'field_name' => 'field_media_audio_file',
    'entity_type' => 'media',
    'bundle' => 'audio',
    'label' => 'Audio 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' => 'mp3 wav aac m4a',
      'max_filesize' => '',
      'handler' => 'default:file',
      'handler_settings' => [],
    ],
    'field_type' => 'file',
  ], $this
    ->getImportantEntityProperties($field_config));
}