You are here

protected function KernelTestBase::beforePrepareEnvironment in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/KernelTestBase.php \Drupal\simpletest\KernelTestBase::beforePrepareEnvironment()

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 105
Contains \Drupal\simpletest\KernelTestBase.

Class

KernelTestBase
Base class for 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') ?: array();
    $this->themeFiles = \Drupal::state()
      ->get('system.theme.files') ?: array();
  }
}