class SettingsStack

Class SettingsStack

The settings stack allows you to temporarily change (then restore) settings. It's intended primarily for use in testing.

Like the global $civicrm_setting variable, it works best with typical inert settings that do not trigger extra activation logic. A handful of settings (such as enable_components and ~5 others) should be avoided, but most settings should work.

Properties

protected array $stack

Methods

push($setting, $settingValue)

Temporarily apply a setting.

popAll()

Restore original settings.

Details

at line 30
push($setting, $settingValue)

Temporarily apply a setting.

Parameters

$setting
$settingValue

at line 44
popAll()

Restore original settings.