3 namespace Drupal\Tests\views\Kernel;
5 use Drupal\Tests\SchemaCheckTestTrait;
6 use Drupal\config_test\TestInstallStorage;
7 use Drupal\Core\Config\InstallStorage;
8 use Drupal\Core\Config\TypedConfigManager;
9 use Drupal\KernelTests\KernelTestBase;
12 * Tests that test views provided by all modules match schema.
16 class TestViewsTest extends KernelTestBase {
18 use SchemaCheckTestTrait;
25 public static $modules = ['views_test_data'];
28 * Tests default configuration data type.
30 public function testDefaultConfig() {
31 // Create a typed config manager with access to configuration schema in
32 // every module, profile and theme.
33 $typed_config = new TypedConfigManager(
34 \Drupal::service('config.storage'),
35 new TestInstallStorage(InstallStorage::CONFIG_SCHEMA_DIRECTORY),
36 \Drupal::service('cache.discovery'),
37 \Drupal::service('module_handler'),
38 \Drupal::service('class_resolver')
41 // Create a configuration storage with access to default configuration in
42 // every module, profile and theme.
43 $default_config_storage = new TestInstallStorage('test_views');
45 foreach ($default_config_storage->listAll() as $config_name) {
46 // Skip files provided by the config_schema_test module since that module
47 // is explicitly for testing schema.
48 if (strpos($config_name, 'config_schema_test') === 0) {
52 $data = $default_config_storage->read($config_name);
53 $this->assertConfigSchema($typed_config, $config_name, $data);