You are here

protected function BrowserTestBase::writeSettings in Zircon Profile 8

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

Rewrites the settings.php file of the test site.

Parameters

array $settings: An array of settings to write out, in the format expected by drupal_rewrite_settings().

See also

drupal_rewrite_settings()

1 call to BrowserTestBase::writeSettings()
BrowserTestBase::installDrupal in core/modules/simpletest/src/BrowserTestBase.php
Installs Drupal into the Simpletest site.

File

core/modules/simpletest/src/BrowserTestBase.php, line 1184
Contains \Drupal\simpletest\BrowserTestBase.

Class

BrowserTestBase
Provides a test case for functional Drupal tests.

Namespace

Drupal\simpletest

Code

protected function writeSettings(array $settings) {
  include_once DRUPAL_ROOT . '/core/includes/install.inc';
  $filename = $this->siteDirectory . '/settings.php';

  // system_requirements() removes write permissions from settings.php
  // whenever it is invoked.
  // Not using File API; a potential error must trigger a PHP warning.
  chmod($filename, 0666);
  drupal_rewrite_settings($settings, $filename);
}