public function TestBase::configImporter

Returns a ConfigImporter object to import test importing of configuration.

Return value

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

File

drupal/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php, line 1296
Definition of 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.
    $config_comparer = new StorageComparer($this->container
      ->get('config.storage.staging'), $this->container
      ->get('config.storage'));
    $this->configImporter = new ConfigImporter($config_comparer, $this->container
      ->get('event_dispatcher'), $this->container
      ->get('config.factory'), $this->container
      ->get('plugin.manager.entity'), $this->container
      ->get('lock'));
  }

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