You are here

protected function DrupalKernelTest::setUp in Zircon Profile 8

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

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

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

Class

DrupalKernelTest
Tests DIC compilation to disk.

Namespace

Drupal\system\Tests\DrupalKernel

Code

protected function setUp() {

  // DrupalKernel relies on global $config_directories and requires those
  // directories to exist. Therefore, create the directories, but do not
  // invoke KernelTestBase::setUp(), since that would set up further
  // environment aspects, which would distort this test, because it tests
  // the DrupalKernel (re-)building itself.
  $this
    ->prepareConfigDirectories();
  $this
    ->settingsSet('php_storage', array(
    'service_container' => array(
      'bin' => 'service_container',
      'class' => 'Drupal\\Component\\PhpStorage\\MTimeProtectedFileStorage',
      'directory' => DRUPAL_ROOT . '/' . $this->publicFilesDirectory . '/php',
      'secret' => Settings::getHashSalt(),
    ),
  ));
}