You are here

public function DrushWithCoreMigrationsFromFileTest::testAllMigrationWithDrush in Media Migration 8

Test all migrations with Drush and Migrate Tools.

@depends testMigrationWithDrush

File

tests/src/Functional/DrushWithCoreMigrationsFromFileTest.php, line 142

Class

DrushWithCoreMigrationsFromFileTest
Tests Migrate Tools and Drush compatibility – verifies usage steps in README.

Namespace

Drupal\Tests\media_migration\Functional

Code

public function testAllMigrationWithDrush() {

  // Execute file migrations.
  // @code
  // drush migrate:import d7_file
  // @endcode
  $this
    ->drush('migrate:import', [
    'd7_file',
  ]);

  // 'Change' back 'file_public_path' variable.
  $this->sourceDatabase
    ->delete('variable')
    ->condition('name', 'file_public_path')
    ->execute();

  // Execute every Drupal 7 migrations.
  // @code
  // drush migrate:import --execute-dependencies --tag="Drupal 7"
  // @endcode
  $this
    ->drush('migrate:import', [
    '--execute-dependencies',
  ], [
    'tag' => 'Drupal 7',
  ]);
  $this
    ->resetAll();
  $this
    ->assertNonMediaToMedia1FieldValues();
  $this
    ->assertNonMediaToMedia2FieldValues();
  $this
    ->assertNonMediaToMedia3FieldValues();
  $this
    ->assertNonMediaToMedia6FieldValues();
  $this
    ->assertNonMediaToMedia7FieldValues();
  $this
    ->assertNonMediaToMedia8FieldValues();
  $this
    ->assertNonMediaToMedia9FieldValues();
  $this
    ->assertNonMediaToMedia10FieldValues();
  $this
    ->assertNonMediaToMedia11FieldValues();
  $this
    ->assertNonMediaToMedia12FieldValues();
}