You are here

protected function WebTestBase::writeSettings in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/WebTestBase.php \Drupal\simpletest\WebTestBase::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()

20 calls to WebTestBase::writeSettings()
ConfigEntityFormOverrideTest::testFormsWithOverrides in core/modules/config/src/Tests/ConfigEntityFormOverrideTest.php
Tests that overrides do not affect forms or listing screens.
ConfigFormOverrideTest::testFormsWithOverrides in core/modules/config/src/Tests/ConfigFormOverrideTest.php
Tests that overrides do not affect forms.
ConfigTest::testFileConfigurationPage in core/modules/system/src/Tests/File/ConfigTest.php
Tests file configuration page.
ConfigTranslationOverviewTest::testListingPageWithOverrides in core/modules/config_translation/src/Tests/ConfigTranslationOverviewTest.php
Tests that overrides do not affect listing screens.
ContainerRebuildWebTest::testContainerInvalidation in core/modules/system/src/Tests/DrupalKernel/ContainerRebuildWebTest.php
Tests container invalidation.

... See full list

File

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

Class

WebTestBase
Test case for typical 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);
}