You are here

public function DrupalKernelTest::testRepeatedBootWithDifferentEnvironment in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php \Drupal\system\Tests\DrupalKernel\DrupalKernelTest::testRepeatedBootWithDifferentEnvironment()

Tests repeated loading of compiled DIC with different environment.

File

core/modules/system/src/Tests/DrupalKernel/DrupalKernelTest.php, line 159
Contains \Drupal\system\Tests\DrupalKernel\DrupalKernelTest.

Class

DrupalKernelTest
Tests DIC compilation to disk.

Namespace

Drupal\system\Tests\DrupalKernel

Code

public function testRepeatedBootWithDifferentEnvironment() {
  $request = Request::createFromGlobals();
  $class_loader = (require DRUPAL_ROOT . '/autoload.php');
  $environments = [
    'testing1',
    'testing1',
    'testing2',
    'testing2',
  ];
  foreach ($environments as $environment) {
    $kernel = DrupalKernel::createFromRequest($request, $class_loader, $environment);
    $this
      ->settingsSet('container_yamls', []);
    $this
      ->settingsSet('hash_salt', $this->databasePrefix);
    $kernel
      ->boot();
  }
  $this
    ->pass('Repeatedly loaded compiled DIC with different environment');
}