You are here

protected function MediaMigrationTestBase::executeMediaMigrations in Media Migration 8

Executes migrations of the media source database.

Parameters

bool $classic_node_migration: Whether the classic node migration has to be executed or not.

5 calls to MediaMigrationTestBase::executeMediaMigrations()
MediaMigrationFormatterWidgetTest::testWidgetsAndFormattersWithMediaLibrary in tests/src/Kernel/Migrate/MediaMigrationFormatterWidgetTest.php
Tests media widgets' and formatters' migration with Media Library.
MediaMigrationFormatterWidgetTest::testWidgetsAndFormattersWithoutMediaLibrary in tests/src/Kernel/Migrate/MediaMigrationFormatterWidgetTest.php
Tests media widgets' and formatters' migration without Media Library.
MediaMigrationTest::testChangeTracking in tests/src/Kernel/Migrate/MediaMigrationTest.php
Tests media entity migration with change tracking enabled.
MediaMigrationTest::testMediaMigration in tests/src/Kernel/Migrate/MediaMigrationTest.php
Tests the migration of media entities.
MediaMigrationWithoutImageTitleTest::testMediaWithoutImageTitleMigration in tests/src/Kernel/Migrate/MediaMigrationWithoutImageTitleTest.php
Tests the migration of media entities without image title.
1 method overrides MediaMigrationTestBase::executeMediaMigrations()
MediaMigrationPlainTestBase::executeMediaMigrations in tests/src/Kernel/Migrate/MediaMigrationPlainTestBase.php
Executes migrations of the media source database.

File

tests/src/Kernel/Migrate/MediaMigrationTestBase.php, line 108

Class

MediaMigrationTestBase
Base class for Media Migration kernel tests.

Namespace

Drupal\Tests\media_migration\Kernel\Migrate

Code

protected function executeMediaMigrations(bool $classic_node_migration = FALSE) {

  // The Drupal 8|9 entity revision migration causes a file not found
  // exception without properly migrated files. For this test, it is enough to
  // properly migrate the public files.
  $fs_fixture_path = implode(DIRECTORY_SEPARATOR, [
    DRUPAL_ROOT,
    drupal_get_path('module', 'media_migration'),
    'tests',
    'fixtures',
  ]);
  $file_migration = $this
    ->getMigration('d7_file');
  $source = $file_migration
    ->getSourceConfiguration();
  $source['constants']['source_base_path'] = $fs_fixture_path;
  $file_migration
    ->set('source', $source);
  $this
    ->executeMigration($file_migration);
  $this
    ->executeMediaConfigurationMigrations();
  $this
    ->executeMigrations([
    'd7_view_modes',
    'd7_field',
    'd7_comment_type',
    'd7_node_type',
    'd7_field_instance',
    'd7_field_formatter_settings',
    'd7_field_instance_widget_settings',
    'd7_embed_button_media',
    'd7_filter_format',
    'd7_user_role',
    'd7_user',
    'd7_file_entity',
    $classic_node_migration ? 'd7_node' : 'd7_node_complete',
  ]);
}