diff --git a/core/modules/config/src/Tests/SchemaCheckTestTrait.php b/core/modules/config/src/Tests/SchemaCheckTestTrait.php index c5b4cba..a0d3e99 100644 --- a/core/modules/config/src/Tests/SchemaCheckTestTrait.php +++ b/core/modules/config/src/Tests/SchemaCheckTestTrait.php @@ -49,4 +49,13 @@ public function assertConfigSchema(TypedConfigManagerInterface $typed_config, $c } } } + + /** + * @param $config_name + */ + public function assertConfigSchemaByName($config_name) { + $config = \Drupal::config($config_name); + $this->assertConfigSchema(\Drupal::service('config.typed'), $config->getName(), $config->get()); + } + } diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view.yml index 164abad..27b1121 100644 --- a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view.yml +++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_view.yml @@ -38,7 +38,7 @@ display: options: offset: '0' type: none - pager_options: { } + pager_options: false sorts: id: field: id diff --git a/core/modules/views_ui/src/Tests/FilterNumericWebTest.php b/core/modules/views_ui/src/Tests/FilterNumericWebTest.php index 09eff65..5c6ab33 100644 --- a/core/modules/views_ui/src/Tests/FilterNumericWebTest.php +++ b/core/modules/views_ui/src/Tests/FilterNumericWebTest.php @@ -7,6 +7,8 @@ namespace Drupal\views_ui\Tests; +use Drupal\config\Tests\SchemaCheckTestTrait; + /** * Tests the numeric filter UI. * @@ -14,6 +16,7 @@ * @see \Drupal\views\Plugin\views\filter\Numeric */ class FilterNumericWebTest extends UITestBase { + use SchemaCheckTestTrait; /** * Views used by this test. @@ -43,9 +46,17 @@ public function testFilterNumericUI() { $edit['options[group_info][group_items][3][value][value]'] = 1; $this->drupalPostForm(NULL, $edit, t('Apply')); - $this->drupalPostForm('admin/structure/views/view/test_view', array(), t('Save')); + $this->assertConfigSchemaByName('views.view.test_view'); + // Change the filter to a single filter to test the schema when the operator + // is not exposed. + $this->drupalPostForm('admin/structure/views/nojs/handler/test_view/default/filter/age', array(), t('Single filter')); + $edit = array(); + $edit['options[value][value]'] = 12; + $this->drupalPostForm(NULL, $edit, t('Apply')); + $this->drupalPostForm('admin/structure/views/view/test_view', array(), t('Save')); + $this->assertConfigSchemaByName('views.view.test_view'); } }