$this->
markTestSkipped('The pdo_sqlite extension is not available.'
);
} // Initialize the DIC with a fake module handler for alterable queries.
$container =
new ContainerBuilder();
$container->
set('module_handler',
$this->
createMock('\Drupal\Core\Extension\ModuleHandlerInterface'
));
\Drupal::
setContainer($container);
// Create the tables and load them up with data, skipping empty ones.
foreach (array_filter($database_contents) as $table =>
$rows) { $pilot_row =
reset($rows);
$connection->
schema()->
createTable($table,
$this->
createSchemaFromRow($pilot_row));
$insert =
$connection->
insert($table)->
fields(array_keys($pilot_row));
array_walk($rows,
[$insert, 'values'
]);
$insert->
execute();
} return $connection;
} /**
* Generates a table schema from a row.
*
* @param array $row
* The reference row on which to base the schema.
*
* @return array
* The Schema API-ready table schema.
*/