private function setupDB(Connection
$orgConnection): Connection
{ // Be sure that we are on the no migrations db
static::
assertStringContainsString('_no_migrations',
$this->databaseName, 'Wrong DB ' .
$this->databaseName
);
$orgConnection->
executeStatement('DROP DATABASE IF EXISTS `' .
$this->databaseName . '`'
);
$orgConnection->
executeStatement('CREATE DATABASE `' .
$this->databaseName . '` DEFAULT CHARACTER SET utf8mb4 DEFAULT COLLATE utf8mb4_unicode_ci'
);
$connection =
new Connection( array_merge( $orgConnection->
getParams(),
[ 'url' =>
$_SERVER['DATABASE_URL'
],
'dbname' =>
$this->databaseName,
] ),
$orgConnection->
getDriver(),
$orgConnection->
getConfiguration(),
);
/** @var string $dumpFile */
$dumpFile =
file_get_contents(__DIR__ . '/../../schema.sql'
);