You are here

protected function FunctionalTestSetupTrait::writeSettings in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php \Drupal\Core\Test\FunctionalTestSetupTrait::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()

31 calls to FunctionalTestSetupTrait::writeSettings()
ConfigEntityFormOverrideTest::testFormsWithOverrides in core/modules/config/tests/src/Functional/ConfigEntityFormOverrideTest.php
Tests that overrides do not affect forms or listing screens.
ConfigExportUITest::setUp in core/modules/config/tests/src/Functional/ConfigExportUITest.php
ConfigFormOverrideTest::testFormsWithOverrides in core/modules/config/tests/src/Functional/ConfigFormOverrideTest.php
Tests that overrides do not affect forms.
ConfigTest::testFileConfigurationPage in core/modules/system/tests/src/Functional/File/ConfigTest.php
Tests file configuration page.
ConfigTranslationOverviewTest::testListingPageWithOverrides in core/modules/config_translation/tests/src/Functional/ConfigTranslationOverviewTest.php
Tests that overrides do not affect listing screens.

... See full list

1 method overrides FunctionalTestSetupTrait::writeSettings()
SecurityAdvisoryTest::writeSettings in core/modules/system/tests/src/Functional/SecurityAdvisories/SecurityAdvisoryTest.php
Rewrites the settings.php file of the test site.

File

core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php, line 159

Class

FunctionalTestSetupTrait
Defines a trait for shared functional test setup functionality.

Namespace

Drupal\Core\Test

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);
}