You are here

public function ConfigImporterTest::testIsInstallable in Drupal 9

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php \Drupal\KernelTests\Core\Config\ConfigImporterTest::testIsInstallable()

Tests the isInstallable method()

File

core/tests/Drupal/KernelTests/Core/Config/ConfigImporterTest.php, line 538

Class

ConfigImporterTest
Tests importing configuration from files into active configuration.

Namespace

Drupal\KernelTests\Core\Config

Code

public function testIsInstallable() {
  $config_name = 'config_test.dynamic.isinstallable';
  $this
    ->assertFalse($this->container
    ->get('config.storage')
    ->exists($config_name));
  \Drupal::state()
    ->set('config_test.isinstallable', TRUE);
  $this
    ->installConfig([
    'config_test',
  ]);
  $this
    ->assertTrue($this->container
    ->get('config.storage')
    ->exists($config_name));
}