You are here

private function MediaMigrationTestDatabaseTrait::cleanupSourceMigrateConnection in Media Migration 8

Cleans up the test migrate connection.

@todo Refactor when core don't use global. https://www.drupal.org/node/2552791

See also

\Drupal\Tests\migrate\Kernel\MigrateTestBase::cleanupMigrateConnection()

1 call to MediaMigrationTestDatabaseTrait::cleanupSourceMigrateConnection()
MediaMigrationSourceTestBase::tearDown in tests/src/Kernel/Plugin/migrate/source/d7/MediaMigrationSourceTestBase.php

File

tests/src/Traits/MediaMigrationTestDatabaseTrait.php, line 90

Class

MediaMigrationTestDatabaseTrait
Trait for importing custom data into the migrate source database.

Namespace

Drupal\Tests\media_migration\Traits

Code

private function cleanupSourceMigrateConnection() {
  Database::removeConnection('migrate');
  $original_connection_info = Database::getConnectionInfo('simpletest_original_migrate');
  if ($original_connection_info) {
    Database::renameConnection('simpletest_original_migrate', 'migrate');
  }
}