You are here

protected function ConfigImporterTest::setUp in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/config/src/Tests/ConfigImporterTest.php \Drupal\config\Tests\ConfigImporterTest::setUp()

Performs setup tasks before each individual test method is run.

Overrides KernelTestBase::setUp

File

core/modules/config/src/Tests/ConfigImporterTest.php, line 38
Contains \Drupal\config\Tests\ConfigImporterTest.

Class

ConfigImporterTest
Tests importing configuration from files into active configuration.

Namespace

Drupal\config\Tests

Code

protected function setUp() {
  parent::setUp();
  $this
    ->installConfig(array(
    'config_test',
  ));

  // Installing config_test's default configuration pollutes the global
  // variable being used for recording hook invocations by this test already,
  // so it has to be cleared out manually.
  unset($GLOBALS['hook_config_test']);
  $this
    ->copyConfig($this->container
    ->get('config.storage'), $this->container
    ->get('config.storage.sync'));

  // Set up the ConfigImporter object for testing.
  $storage_comparer = new StorageComparer($this->container
    ->get('config.storage.sync'), $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'));
}