You are here

public function TestBase::configImporter in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/simpletest/src/TestBase.php \Drupal\simpletest\TestBase::configImporter()

Returns a ConfigImporter object to import test importing of configuration.

Return value

\Drupal\Core\Config\ConfigImporter The ConfigImporter object.

1 call to TestBase::configImporter()
ConfigImportUITest::testImportLock in core/modules/config/src/Tests/ConfigImportUITest.php
Tests concurrent importing of configuration.

File

core/modules/simpletest/src/TestBase.php, line 1568
Contains \Drupal\simpletest\TestBase.

Class

TestBase
Base class for Drupal tests.

Namespace

Drupal\simpletest

Code

public function configImporter() {
  if (!$this->configImporter) {

    // 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, $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'));
  }

  // Always recalculate the changelist when called.
  return $this->configImporter
    ->reset();
}