You are here

protected function WebTestBase::initSettings in Zircon Profile 8

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

Initialize settings created during install.

2 calls to WebTestBase::initSettings()
UpdatePathTestBase::setUp in core/modules/system/src/Tests/Update/UpdatePathTestBase.php
Overrides WebTestBase::setUp() for update testing.
WebTestBase::setUp in core/modules/simpletest/src/WebTestBase.php
Sets up a Drupal site for running functional and integration tests.

File

core/modules/simpletest/src/WebTestBase.php, line 796
Contains \Drupal\simpletest\WebTestBase.

Class

WebTestBase
Test case for typical Drupal tests.

Namespace

Drupal\simpletest

Code

protected function initSettings() {
  Settings::initialize(DRUPAL_ROOT, $this->siteDirectory, $this->classLoader);
  foreach ($GLOBALS['config_directories'] as $type => $path) {
    $this->configDirectories[$type] = $path;
  }

  // After writing settings.php, the installer removes write permissions
  // from the site directory. To allow drupal_generate_test_ua() to write
  // a file containing the private key for drupal_valid_test_ua(), the site
  // directory has to be writable.
  // TestBase::restoreEnvironment() will delete the entire site directory.
  // Not using File API; a potential error must trigger a PHP warning.
  chmod(DRUPAL_ROOT . '/' . $this->siteDirectory, 0777);

  // During tests, cacheable responses should get the debugging cacheability
  // headers by default.
  $this
    ->setContainerParameter('http.response.debug_cacheability_headers', TRUE);
}