/**
* Bootstraps a basic test environment.
*
* Should not be called by tests. Only visible for DrupalKernel integration
* tests.
*
* @see \Drupal\KernelTests\Core\DrupalKernel\DrupalKernelTest
* @internal
*/
protected function bootEnvironment() { \Drupal::
unsetContainer();
$this->classLoader =
require $this->root . '/autoload.php';
// Set up virtual filesystem.
Database::
addConnectionInfo('default', 'test-runner',
$this->
getDatabaseConnectionInfo()['default'
]);
$test_db =
new TestDatabase();
$this->siteDirectory =
$test_db->
getTestSitePath();
// Ensure that all code that relies on drupal_valid_test_ua() can still be
// safely executed. This primarily affects the (test) site directory
// resolution (used by e.g. LocalStream and PhpStorage).