You are here

protected function MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaImageMediaBundleSourceFieldProperties in Media Migration 8

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

2 calls to MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaImageMediaBundleSourceFieldProperties()
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 487

Class

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

Namespace

Drupal\Tests\media_migration\Traits

Code

protected function assertNonMediaToMediaImageMediaBundleSourceFieldProperties() {
  $field_config = $this->container
    ->get('entity_type.manager')
    ->getStorage('field_config')
    ->load('media.image.field_media_image');
  assert($field_config instanceof FieldConfigInterface);
  $this
    ->assertEquals([
    'id' => 'media.image.field_media_image',
    'status' => TRUE,
    'field_name' => 'field_media_image',
    'entity_type' => 'media',
    'bundle' => 'image',
    'label' => 'Image',
    'description' => '',
    'required' => TRUE,
    'translatable' => TRUE,
    'default_value' => [],
    'default_value_callback' => '',
    'settings' => [
      'alt_field' => TRUE,
      'alt_field_required' => TRUE,
      'title_field' => FALSE,
      'title_field_required' => FALSE,
      'max_resolution' => '',
      'min_resolution' => '',
      'default_image' => [
        'uuid' => NULL,
        'alt' => '',
        'title' => '',
        'width' => NULL,
        'height' => NULL,
      ],
      'file_directory' => '[date:custom:Y]-[date:custom:m]',
      'file_extensions' => 'png gif jpg jpeg webp',
      'max_filesize' => '',
      'handler' => 'default:file',
      'handler_settings' => [],
    ],
    'field_type' => 'image',
  ], $this
    ->getImportantEntityProperties($field_config));
}