protected function MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaDocumentMediaBundleSourceFieldProperties in Media Migration 8
Checks the properties of the document media type's source field config.
2 calls to MediaMigrationAssertionsForNonMediaSourceTrait::assertNonMediaToMediaDocumentMediaBundleSourceFieldProperties()
- 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 532
Class
- MediaMigrationAssertionsForNonMediaSourceTrait
- Trait for non-media source to media migration tests.
Namespace
Drupal\Tests\media_migration\TraitsCode
protected function assertNonMediaToMediaDocumentMediaBundleSourceFieldProperties() {
$field_config = $this->container
->get('entity_type.manager')
->getStorage('field_config')
->load('media.document.field_media_document');
assert($field_config instanceof FieldConfigInterface);
$this
->assertEquals([
'id' => 'media.document.field_media_document',
'status' => TRUE,
'field_name' => 'field_media_document',
'entity_type' => 'media',
'bundle' => 'document',
'label' => 'Document',
'description' => '',
'required' => TRUE,
'translatable' => TRUE,
'default_value' => [],
'default_value_callback' => '',
'settings' => [
'description_field' => TRUE,
'file_directory' => '[date:custom:Y]-[date:custom:m]',
'file_extensions' => 'txt doc docx pdf odt',
'max_filesize' => '',
'handler' => 'default:file',
'handler_settings' => [],
],
'field_type' => 'file',
], $this
->getImportantEntityProperties($field_config));
}