You are here

public function DrushWithCoreMigrationsFromMediaTest::testAllMigrationWithDrush in Media Migration 8

Test all migrations with Drush and Migrate Tools.

@depends testMigrationWithDrush

File

tests/src/Functional/DrushWithCoreMigrationsFromMediaTest.php, line 156

Class

DrushWithCoreMigrationsFromMediaTest
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
    ->assertMedia1FieldValues();
  $this
    ->assertMedia2FieldValues();
  $this
    ->assertMedia3FieldValues();
  $this
    ->assertMedia4FieldValues();
  $this
    ->assertMedia5FieldValues();
  $this
    ->assertMedia6FieldValues();
  $this
    ->assertMedia7FieldValues();
  $this
    ->assertMedia8FieldValues();
  $this
    ->assertMedia9FieldValues();
  $this
    ->assertMedia10FieldValues();
  $this
    ->assertMedia11FieldValues();
  $this
    ->assertMedia12FieldValues();
}