You are here

public function MigrateEmbedMediaTokenToMediaEmbedTest::providerMediaEmbedTransform in Media Migration 8

Data provider for ::testMediaTokenToMediaEmbedTransform().

Return value

array The test cases.

File

tests/src/Functional/MigrateEmbedMediaTokenToMediaEmbedTest.php, line 85

Class

MigrateEmbedMediaTokenToMediaEmbedTest
Tests the transformation of embed image media tokens to media_embed.

Namespace

Drupal\Tests\media_migration\Functional

Code

public function providerMediaEmbedTransform() {
  $test_cases = [
    // ID reference method. This should be neutral for media_embed token
    // transform destination.
    'ID reference method, no additional modules, preexisting media types' => [
      'reference method' => 'id',
      'additional modules' => [],
      'Preexisting media types' => TRUE,
    ],
    'ID reference method, Entity Embed installed, preexisting media types' => [
      'reference method' => 'id',
      'additional modules' => [
        'entity_embed',
      ],
      'Preexisting media types' => TRUE,
    ],
    // UUID reference method.
    'UUID reference method, no additional modules, preexisting media types' => [
      'reference method' => 'uuid',
      'additional modules' => [],
      'Preexisting media types' => TRUE,
    ],
    'UUID reference method, Entity Embed installed, preexisting media types' => [
      'reference method' => 'uuid',
      'additional modules' => [
        'entity_embed',
      ],
      'Preexisting media types' => TRUE,
    ],
  ];

  // Add 'no initial media types' test cases.
  $test_cases_without_media_types = [];
  foreach ($test_cases as $test_case_label => $test_case) {
    $without_media_label = preg_replace('/preexisting media types$/', 'no media types', $test_case_label);
    $test_case['Preexisting media types'] = FALSE;
    $test_cases_without_media_types[$without_media_label] = $test_case;
  }
  $test_cases += $test_cases_without_media_types;
  return $test_cases;
}