$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).
$this->databasePrefix =
$test_db->
getDatabasePrefix();
drupal_valid_test_ua($this->databasePrefix
);
$settings =
[ 'hash_salt' =>
static::
class,
'file_public_path' =>
$this->siteDirectory . '/files',
// Disable Twig template caching/dumping.
'twig_cache' => FALSE,
// @see \Drupal\KernelTests\KernelTestBase::register()
];
new Settings($settings);
$this->
setUpFilesystem();