if (str_contains($autoload, 'src/Driver/Database/'
)) { [$first,
$second] =
explode('\\',
$namespace, 3
);
if ($first === 'Drupal' &&
strtolower($second) ===
$second) { // Add the module that provides the database driver to the list of
// modules as the first to be enabled.
array_unshift($modules,
$second);
} } // Bootstrap the kernel. Do not use createFromRequest() to retain Settings.
$kernel =
new DrupalKernel('testing',
$this->classLoader, FALSE
);
$kernel->
setSitePath($this->siteDirectory
);
// Boot a new one-time container from scratch. Set the module list upfront
// to avoid a subsequent rebuild or setting the kernel into the
// pre-installer mode.
$extensions =
$modules ?
$this->
getExtensionsForModules($modules) :
[];
$kernel->
updateModules($extensions,
$extensions);
// DrupalKernel::boot() is not sufficient as it does not invoke preHandle(),
// which is required to initialize legacy global variables.
$request = Request::
create('/'
);
$kernel->
boot();
$request->attributes->
set(RouteObjectInterface::ROUTE_OBJECT,
new Route('<none>'
));