function TestBase::settingsSet

Changes in memory settings.

Parameters

$name: The name of the setting to return.

$value: The value of the setting.

See also

\Drupal\Core\Site\Settings::get()

2 calls to TestBase::settingsSet()
KernelTestBase::setUp in core/modules/simpletest/src/KernelTestBase.php
Performs setup tasks before each individual test method is run.
WebTestBase::writeCustomTranslations in core/modules/simpletest/src/WebTestBase.php
Writes custom translations to the test site's settings.php.

File

core/modules/simpletest/src/TestBase.php, line 1363

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

protected function settingsSet($name, $value) {
    $settings = Settings::getAll();
    $settings[$name] = $value;
    new Settings($settings);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.