protected function MediaMigrationAssertionsBaseTrait::assertMediaDocumentDisplayModes in Media Migration 8
Tests media documents's default form and view mode configuration.
2 calls to MediaMigrationAssertionsBaseTrait::assertMediaDocumentDisplayModes()
- 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 270
Class
- MediaMigrationAssertionsBaseTrait
- Trait for media migration tests.
Namespace
Drupal\Tests\media_migration\TraitsCode
protected function assertMediaDocumentDisplayModes() {
$entity_form_display = $this->container
->get('entity_type.manager')
->getStorage('entity_form_display')
->load(implode('.', [
'media',
'document',
'default',
]));
$this
->assertEquals([
'status' => TRUE,
'id' => 'media.document.default',
'targetEntityType' => 'media',
'bundle' => 'document',
'mode' => 'default',
'content' => [
'created' => [
'type' => 'datetime_timestamp',
'weight' => 10,
'region' => 'content',
'settings' => [],
'third_party_settings' => [],
],
'field_media_document' => [
'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',
'document',
'default',
]));
$this
->assertEquals([
'status' => TRUE,
'id' => 'media.document.default',
'targetEntityType' => 'media',
'bundle' => 'document',
'mode' => 'default',
'content' => [
'field_media_document' => [
'type' => 'file_default',
'weight' => 0,
'settings' => [
'use_description_as_link_text' => TRUE,
],
'third_party_settings' => [],
'region' => 'content',
'label' => 'visually_hidden',
],
],
'hidden' => [
'created' => TRUE,
'name' => TRUE,
'thumbnail' => TRUE,
'uid' => TRUE,
],
], $this
->getImportantEntityProperties($entity_view_display));
}