You are here

protected function ConfigSnapshotTest::setUp in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php \Drupal\KernelTests\Core\Config\ConfigSnapshotTest::setUp()
  2. 9 core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php \Drupal\KernelTests\Core\Config\ConfigSnapshotTest::setUp()

Overrides KernelTestBase::setUp

File

core/tests/Drupal/KernelTests/Core/Config/ConfigSnapshotTest.php, line 25

Class

ConfigSnapshotTest
Tests config snapshot creation and updating.

Namespace

Drupal\KernelTests\Core\Config

Code

protected function setUp() : void {
  parent::setUp();
  $this
    ->installConfig([
    'system',
  ]);

  // Update the config snapshot. This allows the parent::setUp() to write
  // configuration files.
  \Drupal::service('config.manager')
    ->createSnapshot(\Drupal::service('config.storage'), \Drupal::service('config.storage.snapshot'));
  $this
    ->copyConfig($this->container
    ->get('config.storage'), $this->container
    ->get('config.storage.sync'));
}