function DefaultConfigTest::testDefaultConfig

Same name in other branches
  1. 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 60

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) {
        // Skip files provided by the config_schema_test module since that module
        // is explicitly for testing schema.
        if (strpos($config_name, 'config_schema_test') === 0) {
            continue;
        }
        $data = $default_config_storage->read($config_name);
        $this->assertConfigSchema($typed_config, $config_name, $data);
    }
}

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