function KernelTestBase::setSetting
Sets an in-memory Settings variable.
Parameters
string $name: The name of the setting to set.
bool|string|int|array|null $value: The value to set. Note that array values are replaced entirely; use \Drupal\Core\Site\Settings::get() to perform custom merges.
23 calls to KernelTestBase::setSetting()
- DateFormatterTest::setUp in core/tests/ Drupal/ KernelTests/ Core/ Datetime/ DateFormatterTest.php 
- DateFormatterTest::testRfc2822DateFormat in core/tests/ Drupal/ KernelTests/ Core/ Datetime/ DateFormatterTest.php 
- Tests that an RFC2822 formatted date always returns an English string.
- DirectoryTest::testFileCheckDirectoryHandling in core/tests/ Drupal/ KernelTests/ Core/ File/ DirectoryTest.php 
- Tests directory handling functions.
- DrupalKernelSiteTest::testServicesYml in core/tests/ Drupal/ KernelTests/ Core/ DrupalKernel/ DrupalKernelSiteTest.php 
- Tests services.yml in site directory.
- DrupalKernelTest::getTestKernel in core/tests/ Drupal/ KernelTests/ Core/ DrupalKernel/ DrupalKernelTest.php 
- Build a kernel for testings.
File
- 
              core/tests/ Drupal/ KernelTests/ KernelTestBase.php, line 985 
Class
- KernelTestBase
- Base class for functional integration tests.
Namespace
Drupal\KernelTestsCode
protected function setSetting($name, $value) {
  $settings = Settings::getInstance() ? 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.
