function ConfigUninstallViaCliImportTest::setUp

Same name in other branches
  1. 8.9.x core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php \Drupal\Tests\config\Kernel\ConfigUninstallViaCliImportTest::setUp()
  2. 10 core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php \Drupal\Tests\config\Kernel\ConfigUninstallViaCliImportTest::setUp()
  3. 11.x core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php \Drupal\Tests\config\Kernel\ConfigUninstallViaCliImportTest::setUp()

Overrides KernelTestBase::setUp

File

core/modules/config/tests/src/Kernel/ConfigUninstallViaCliImportTest.php, line 32

Class

ConfigUninstallViaCliImportTest
Tests importing configuration from files into active configuration.

Namespace

Drupal\Tests\config\Kernel

Code

protected function setUp() : void {
    parent::setUp();
    if (PHP_SAPI !== 'cli') {
        $this->markTestSkipped('This test has to be run from the CLI');
    }
    $this->installConfig([
        'system',
    ]);
    $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->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'), $this->container
        ->get('extension.list.module'), $this->container
        ->get('extension.list.theme'));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.