function MigrateMissingDatabaseTest::setUp

Same name in this branch
  1. 11.x core/modules/migrate_drupal/tests/src/Kernel/MigrateMissingDatabaseTest.php \Drupal\Tests\migrate_drupal\Kernel\MigrateMissingDatabaseTest::setUp()
Same name in other branches
  1. 10 core/modules/migrate_drupal/tests/src/Kernel/MigrateMissingDatabaseTest.php \Drupal\Tests\migrate_drupal\Kernel\MigrateMissingDatabaseTest::setUp()
  2. 10 core/modules/migrate/tests/src/Kernel/MigrateMissingDatabaseTest.php \Drupal\Tests\migrate\Kernel\MigrateMissingDatabaseTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/migrate/tests/src/Kernel/MigrateMissingDatabaseTest.php, line 35

Class

MigrateMissingDatabaseTest
Tests that a SQL migration can be instantiated without a database connection.

Namespace

Drupal\Tests\migrate\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    $this->migrationPluginManager = \Drupal::service('plugin.manager.migration');
    // Set the 'migrate' database connection to use a missing database.
    $info = Database::getConnectionInfo('default')['default'];
    $info['database'] = 'godot';
    Database::addConnectionInfo('migrate', 'default', $info);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.