You are here

protected function UpdateModeTest::setUpdateMode in Configuration Synchronizer 8.2

3 calls to UpdateModeTest::setUpdateMode()
UpdateModeTest::testUpdateModeFullReset in tests/src/Kernel/UpdateModeTest.php
UpdateModeTest::testUpdateModeMerge in tests/src/Kernel/UpdateModeTest.php
UpdateModeTest::testUpdateModePartialReset in tests/src/Kernel/UpdateModeTest.php

File

tests/src/Kernel/UpdateModeTest.php, line 147

Class

UpdateModeTest
Tests importing configuration entities using various import modes.

Namespace

Drupal\Tests\config_sync\Kernel

Code

protected function setUpdateMode($update_mode) {
  $this->container
    ->get('state')
    ->set('config_sync.update_mode', $update_mode);

  // Rebuild the container to update the config distro storage.
  $this->container
    ->get('kernel')
    ->rebuildContainer();

  // Set up the ConfigImporter object for testing.
  $storage_comparer = new StorageComparer($this->container
    ->get('config_distro.storage.distro'), $this->container
    ->get('config.storage'), $this->container
    ->get('config.manager'));
  $this->configImporter = new ConfigImporter($storage_comparer
    ->createChangelist(), $this->container
    ->get('event_dispatcher'), $this->container
    ->get('config.manager'), $this->container
    ->get('lock'), $this->container
    ->get('config.typed'), $this->container
    ->get('module_handler'), $this->container
    ->get('module_installer'), $this->container
    ->get('theme_handler'), $this->container
    ->get('string_translation'));
}