You are here

protected function KernelTestBase::beforePrepareEnvironment in SimpleTest 8.3

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

src/KernelTestBase.php, line 130

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\simpletest

Code

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') ?: [];
  }
}