protected static $modules =
['migrate'
];
/**
* {@inheritdoc}
*/
protected function setUp(): void
{ parent::
setUp();
$this->
createMigrationConnection();
$this->sourceDatabase = Database::
getConnection('default', 'migrate'
);
// Attach the original test prefix as a database, for SQLite to attach its
// database file.
$this->sourceDatabase->
attachDatabase(substr($this->sourceDatabase->
getConnectionOptions()['prefix'
], 0, -1
));
} /**
* Changes the database connection to the prefixed one.
*
* @todo Remove when we don't use global. https://www.drupal.org/node/2552791
*/
private function createMigrationConnection() { // If the backup already exists, something went terribly wrong.
// This case is possible, because database connection info is a static
// global state construct on the Database class, which at least persists