You are here

protected function KernelTestBase::setSetting in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/tests/Drupal/KernelTests/KernelTestBase.php \Drupal\KernelTests\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.

3 calls to KernelTestBase::setSetting()
KernelTestBase::bootKernel in core/tests/Drupal/KernelTests/KernelTestBase.php
Bootstraps a kernel for a test.
MaintenanceThemeTest::testMaintenanceTheme in core/tests/Drupal/KernelTests/Core/Theme/MaintenanceThemeTest.php
Tests that the maintenance theme initializes the theme and its base themes.
ModuleHandlerTest::testUninstallProfileDependency in core/modules/system/tests/src/Kernel/Extension/ModuleHandlerTest.php
Tests uninstalling a module that is a "dependency" of a profile.

File

core/tests/Drupal/KernelTests/KernelTestBase.php, line 929
Contains \Drupal\KernelTests\KernelTestBase.

Class

KernelTestBase
Base class for functional integration tests.

Namespace

Drupal\KernelTests

Code

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