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')
40 // Create a configuration storage with access to default configuration in
41 // every module, profile and theme.
42 $default_config_storage = new TestInstallStorage('test_views');
44 foreach ($default_config_storage->listAll() as $config_name) {
45 // Skip files provided by the config_schema_test module since that module
46 // is explicitly for testing schema.
47 if (strpos($config_name, 'config_schema_test') === 0) {
51 $data = $default_config_storage->read($config_name);
52 $this->assertConfigSchema($typed_config, $config_name, $data);