You are here

public function MediaMigrationPlainTest::providerTestPlainFileToMediaMigration in Media Migration 8

Data provider for ::testPlainFileToMediaMigration().

Return value

array The test cases.

File

tests/src/Kernel/Migrate/MediaMigrationPlainTest.php, line 82

Class

MediaMigrationPlainTest
Tests media migration from non-media source.

Namespace

Drupal\Tests\media_migration\Kernel\Migrate

Code

public function providerTestPlainFileToMediaMigration() {
  $test_cases = [
    'Classic node migration, no initial media types' => [
      'Classic node migration' => TRUE,
      'Preexisting media types' => FALSE,
    ],
    'Complete node migration, no initial media types' => [
      'Classic node migration' => FALSE,
      'Preexisting media types' => FALSE,
    ],
    'Classic node migration, preexisting media types' => [
      'Classic node migration' => TRUE,
      'Preexisting media types' => TRUE,
    ],
    'Complete node migration, preexisting media types' => [
      'Classic node migration' => FALSE,
      'Preexisting media types' => TRUE,
    ],
  ];

  // Drupal 8.8.x only has 'classic' node migrations.
  // @see https://www.drupal.org/node/3105503
  if (version_compare(\Drupal::VERSION, '8.9', '<')) {
    $test_cases = array_filter($test_cases, function ($test_case) {
      return $test_case['Classic node migration'];
    });
  }
  return $test_cases;
}