You are here

public function DefaultConfigTest::testDefaultConfig in Drupal 10

Same name and namespace in other branches
  1. 8 core/tests/Drupal/KernelTests/Core/Config/DefaultConfigTest.php \Drupal\KernelTests\Core\Config\DefaultConfigTest::testDefaultConfig()
  2. 9 core/tests/Drupal/KernelTests/Core/Config/DefaultConfigTest.php \Drupal\KernelTests\Core\Config\DefaultConfigTest::testDefaultConfig()

Tests default configuration data type.

File

core/tests/Drupal/KernelTests/Core/Config/DefaultConfigTest.php, line 61

Class

DefaultConfigTest
Tests that default configuration provided by all modules matches schema.

Namespace

Drupal\KernelTests\Core\Config

Code

public function testDefaultConfig() {
  $typed_config = \Drupal::service('config.typed');

  // Create a configuration storage with access to default configuration in
  // every module, profile and theme.
  $default_config_storage = new TestInstallStorage();
  foreach ($default_config_storage
    ->listAll() as $config_name) {
    if (in_array($config_name, $this->toSkip)) {
      continue;
    }
    $data = $default_config_storage
      ->read($config_name);
    $this
      ->assertConfigSchema($typed_config, $config_name, $data);
  }
}