diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php index 61eee7e..dfde454 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTestBase.php @@ -2,11 +2,12 @@ /** * @file - * Contains Drupal\config\Tests\DefaultConfigTest. + * Contains Drupal\config\Tests\ConfigSchemaTestBase. */ namespace Drupal\config\Tests; +use Drupal\Core\Config\Schema\ArrayElement; use Drupal\Core\Config\Schema\Property; use Drupal\Core\Config\TypedConfigManagerInterface; use Drupal\Core\TypedData\Type\BooleanInterface; @@ -38,6 +39,8 @@ protected $configName; /** + * Global state for whether the config passed for a name. + * * @var boolean */ protected $configPass; @@ -110,17 +113,13 @@ protected function checkValue($key, $value) { if ($type == 'string' && ($element instanceof StringInterface || $element instanceof Property)) { $success = TRUE; } - // Null values are allowed for all types. + // Null values are allowed for all scalar types. if ($value === NULL) { $success = TRUE; } } - else { - // @todo throw an exception due to an incomplete schema. Only possible - // once https://drupal.org/node/1910624 is complete. - } - $class = get_class($element); if (!$success) { + $class = get_class($element); $this->fail("{$this->configName}:$key has the wrong schema. Variable type is $type and schema class is $class."); } } @@ -129,7 +128,18 @@ protected function checkValue($key, $value) { } } else { - // Any non-scalar value must be an array. + try { + $element = $this->schema->get($key); + if (!$element instanceof ArrayElement) { + $this->fail("{$this->configName}:$key is not defined as an array type (eg. mapping or sequence) but is not a scalar value."); + } + } + catch (SchemaIncompleteException $e) { + $this->fail("{$this->configName}:$key has no schema."); + } + + // Go on processing so we can get errors on all levels. Any non-scalar + // value must be an array so cast to an array. if (!is_array($value)) { $value = (array) $value; } diff --git a/core/modules/update/tests/modules/update_test/config/schema/update_test.schema.yml b/core/modules/update/tests/modules/update_test/config/schema/update_test.schema.yml index cbe32d4..2235f2b 100644 --- a/core/modules/update/tests/modules/update_test/config/schema/update_test.schema.yml +++ b/core/modules/update/tests/modules/update_test/config/schema/update_test.schema.yml @@ -5,19 +5,19 @@ update_test.settings: label: 'Update test settings' mapping: system_info: - type: seqeuence + type: sequence label: 'System info' sequence: - type: string label: 'Value' update_status: - type: seqeuence + type: sequence label: 'Update status' sequence: - type: string label: 'Value' xml_map: - type: seqeuence + type: sequence label: 'XML map' sequence: - type: string diff --git a/core/modules/user/config/schema/user.schema.yml b/core/modules/user/config/schema/user.schema.yml index 7f61921..f8f0d2e 100644 --- a/core/modules/user/config/schema/user.schema.yml +++ b/core/modules/user/config/schema/user.schema.yml @@ -171,3 +171,7 @@ action.configuration.user_remove_role_action: action.configuration.user_unblock_user_action: type: action_configuration_default label: 'Unblock the selected users configuration' + +search.plugin.user_search: + type: mapping + label: 'User search' diff --git a/core/modules/views/config/schema/views.argument_validator.schema.yml b/core/modules/views/config/schema/views.argument_validator.schema.yml index 3dbc9d7..ba0f894 100644 --- a/core/modules/views/config/schema/views.argument_validator.schema.yml +++ b/core/modules/views/config/schema/views.argument_validator.schema.yml @@ -22,8 +22,11 @@ views.argument_validator_entity: type: mapping mapping: bundles: - type: boolean + type: sequence label: 'Bundles' + sequence: + label: 'Bundle' + type: string access: type: boolean label: 'Access' diff --git a/core/modules/views/config/schema/views.data_types.schema.yml b/core/modules/views/config/schema/views.data_types.schema.yml index efbf369..9fa51ed 100644 --- a/core/modules/views/config/schema/views.data_types.schema.yml +++ b/core/modules/views/config/schema/views.data_types.schema.yml @@ -55,6 +55,8 @@ views_display: label: 'Cache type' provider: label: 'Provider' + options: + label: 'Options' empty: type: sequence label: 'No results behavior'