You are here

protected function MigrateMediaTestBase::getExpectedEntities in Media Migration 8

Gets the expected entity IDs and labels per entity type after migration.

Return value

string|null[][] An array of expected entity labels keyed by IDs, grouped by entity type ID. For some of the entities, label can be NULL.

3 calls to MigrateMediaTestBase::getExpectedEntities()
MigrateEmbedMediaTokenTestBase::getExpectedEntities in tests/src/Functional/MigrateEmbedMediaTokenTestBase.php
Gets the expected entity IDs and labels per entity type after migration.
MigrateMediaTestBase::assertEntities in tests/src/Functional/MigrateMediaTestBase.php
Asserts that the expected entities exist.
MigrateMediaTestBase::getEntityCounts in tests/src/Functional/MigrateMediaTestBase.php
Gets the expected number of entities per entity type after migration.
3 methods override MigrateMediaTestBase::getExpectedEntities()
MigrateEmbedMediaTokenTestBase::getExpectedEntities in tests/src/Functional/MigrateEmbedMediaTokenTestBase.php
Gets the expected entity IDs and labels per entity type after migration.
MigrateMediaFromNonMediaSourceTest::getExpectedEntities in tests/src/Functional/MigrateMediaFromNonMediaSourceTest.php
Gets the expected entity IDs and labels per entity type after migration.
MigrateMediaTest::getExpectedEntities in tests/src/Functional/MigrateMediaTest.php
Gets the expected entity IDs and labels per entity type after migration.

File

tests/src/Functional/MigrateMediaTestBase.php, line 103

Class

MigrateMediaTestBase
Provides a base class for testing media migration via the UI.

Namespace

Drupal\Tests\media_migration\Functional

Code

protected function getExpectedEntities() {
  $expected_entities = [
    'editor' => [
      'basic_html' => 'Basic HTML',
      'full_html' => 'Full HTML',
    ],
    'entity_form_display' => [
      'block_content.basic.default' => NULL,
      'comment.comment.default' => NULL,
      'comment.comment_node_article.default' => NULL,
      'comment.comment_node_page.default' => NULL,
      'media.audio.default' => NULL,
      'media.document.default' => NULL,
      'media.image.default' => NULL,
      'media.remote_video.default' => NULL,
      'media.video.default' => NULL,
      'node.article.default' => NULL,
      'node.page.default' => NULL,
      'user.user.default' => NULL,
    ],
    'entity_form_mode' => [
      'user.register' => 'Register',
    ],
    'entity_view_display' => [
      'block_content.basic.default' => NULL,
      'comment.comment.default' => NULL,
      'comment.comment_node_article.default' => NULL,
      'comment.comment_node_page.default' => NULL,
      'media.audio.default' => NULL,
      'media.document.default' => NULL,
      'media.image.default' => NULL,
      'media.remote_video.default' => NULL,
      'media.video.default' => NULL,
      'node.article.default' => NULL,
      'node.article.teaser' => NULL,
      'node.page.default' => NULL,
      'node.page.teaser' => NULL,
      'user.user.compact' => NULL,
      'user.user.default' => NULL,
    ],
    'entity_view_mode' => [
      'block_content.full' => 'Full',
      'comment.full' => 'Full',
      'media.full' => 'Full',
      'media.preview' => 'preview',
      'media.rss' => 'RSS',
      'media.search_index' => 'Search index',
      'media.search_result' => 'Search result',
      'media.teaser' => 'Teaser',
      'media.wysiwyg' => 'WYSIWYG',
      'node.full' => 'Full',
      'node.rss' => 'RSS',
      'node.search_index' => 'Search index',
      'node.search_result' => 'Search result highlighting input',
      'node.teaser' => 'Teaser',
      'taxonomy_term.full' => 'Taxonomy term page',
      'user.compact' => 'Compact',
      'user.full' => 'User account',
    ],
    'field_config' => [
      'block_content.basic.body' => 'Body',
      'comment.comment.comment_body' => 'Comment',
      'comment.comment_node_article.comment_body' => 'Comment',
      'comment.comment_node_page.comment_body' => 'Comment',
      'media.audio.field_media_audio_file' => 'Audio file',
      'media.document.field_media_document' => 'Document',
      'media.image.field_media_image' => 'Image',
      'media.image.field_media_integer' => 'Integer',
      'media.remote_video.field_media_oembed_video' => 'Video URL',
      'media.video.field_media_video_file' => 'Video file',
      'node.article.body' => 'Body',
      'node.article.comment_node_article' => 'Comments',
      'node.article.field_image' => 'Image',
      'node.article.field_media' => 'Media',
      'node.page.body' => 'Body',
      'node.page.comment_node_page' => 'Comments',
      'user.user.user_picture' => 'Picture',
    ],
    'field_storage_config' => [
      'block_content.body' => 'block_content.body',
      'comment.comment_body' => 'comment.comment_body',
      'media.field_media_audio_file' => 'media.field_media_audio_file',
      'media.field_media_document' => 'media.field_media_document',
      'media.field_media_image' => 'media.field_media_image',
      'media.field_media_integer' => 'media.field_media_integer',
      'media.field_media_oembed_video' => 'media.field_media_oembed_video',
      'media.field_media_video_file' => 'media.field_media_video_file',
      'node.body' => 'node.body',
      'node.comment_node_article' => 'node.comment_node_article',
      'node.comment_node_page' => 'node.comment_node_page',
      'node.field_image' => 'node.field_image',
      'node.field_media' => 'node.field_media',
      'user.user_picture' => 'user.user_picture',
    ],
    'filter_format' => [
      'basic_html' => 'Basic HTML',
      'full_html' => 'Full HTML',
      'plain_text' => 'Plain text',
      'restricted_html' => 'Restricted HTML',
      'filtered_html' => 'Filtered HTML',
    ],
    'image_style' => [
      'large' => 'Large (480×480)',
      'medium' => 'Medium (220×220)',
      'thumbnail' => 'Thumbnail (100×100)',
    ],
    'media_type' => [
      'audio' => 'Audio',
      'document' => 'Document',
      'image' => 'Image',
      'remote_video' => 'Remote video',
      'video' => 'Video',
    ],
    'media' => [
      1 => 'Blue PNG',
      2 => 'green.jpg',
      3 => 'red.jpeg',
      4 => 'DrupalCon Amsterdam 2019: Keynote - Driesnote',
      5 => 'Responsive Images in Drupal 8',
      6 => 'LICENSE.txt',
      7 => 'yellow.jpg',
      8 => 'video.webm',
      9 => 'video.mp4',
      10 => 'yellow.webp',
      11 => 'audio.m4a',
      12 => 'document.odt',
    ],
    'file' => [
      1 => 'Blue PNG',
      2 => 'green.jpg',
      3 => 'red.jpeg',
      6 => 'LICENSE.txt',
      7 => 'yellow.jpg',
      8 => 'video.webm',
      9 => 'video.mp4',
      10 => 'yellow.webp',
      11 => 'audio.m4a',
      12 => 'document.odt',
    ],
    'node' => [
      1 => 'Article with embed image media',
      2 => 'Article with only a single image',
    ],
    'node_type' => [
      'article' => 'Article',
      'page' => 'Basic page',
    ],
  ];

  // Drupal core 8.9.x prior 8.9.3 and Drupal core 9.0.x prior 9.0.3 were
  // unable to migrate "filtered_html" filter format due to a but in the
  // "subprocess" migrate process plugin.
  // @todo We can remove this after 8.9.3 and 9.0.3 are released.
  // @see https://drupal.org/i/3126063
  if (version_compare(\Drupal::VERSION, '8.9.0', '>=') && version_compare(\Drupal::VERSION, '8.9.2', '<=') || version_compare(\Drupal::VERSION, '9.0.0', '>=') && version_compare(\Drupal::VERSION, '9.0.2', '<=')) {
    unset($expected_entities['filter_format']['filtered_html']);
  }

  // Drupal 9.1.x ships a new default image style "wide".
  if (version_compare(\Drupal::VERSION, '9.1', '>=')) {
    $expected_entities['image_style']['wide'] = 'Wide (1090)';
  }
  return $expected_entities;
}