protected function KernelTestBase::beforePrepareEnvironment in Drupal 8
Act on global state information before the environment is altered for a test.
Allows e.g. KernelTestBase to prime system/extension info from the parent site (and inject it into the test environment so as to improve performance).
Overrides TestBase::beforePrepareEnvironment
File
- core/
modules/ simpletest/ src/ KernelTestBase.php, line 130
Class
- KernelTestBase
- Base class for functional integration tests.
Namespace
Drupal\simpletestCode
protected function beforePrepareEnvironment() {
// Copy/prime extension file lists once to avoid filesystem scans.
if (!isset($this->moduleFiles)) {
$this->moduleFiles = \Drupal::state()
->get('system.module.files') ?: [];
$this->themeFiles = \Drupal::state()
->get('system.theme.files') ?: [];
}
}