diff --git a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php index 5d8f259..c274fff 100644 --- a/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php +++ b/core/modules/config/lib/Drupal/config/Tests/ConfigSchemaTest.php @@ -59,8 +59,18 @@ function testSchemaMapping() { $expected = array(); $expected['label'] = 'Schema test data'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; - $expected['mapping']['testitem'] = array('label' => 'Test item'); - $expected['mapping']['testlist'] = array('label' => 'Test list'); + $expected['mapping']['testitem'] = array( + 'label' => 'Test item', + 'type' => 'string', + ); + $expected['mapping']['testlist'] = array( + 'label' => 'Test list', + 'type' => 'sequence' + ); + $expected['mapping']['testlist']['sequence'][] = array( + 'type' => 'string', + 'label' => 'Test', + ); $this->assertEqual($definition, $expected, 'Retrieved the right metadata for configuration with only some schema.'); // Check type detection on elements with undefined types. @@ -74,8 +84,12 @@ function testSchemaMapping() { $definition = $config['testlist']->getDefinition(); $expected = array(); $expected['label'] = 'Test list'; - $expected['class'] = '\Drupal\Core\Config\Schema\Property'; - $expected['type'] = 'undefined'; + $expected['class'] = '\Drupal\Core\Config\Schema\Sequence'; + $expected['type'] = 'sequence'; + $expected['sequence'][] = array( + 'type' => 'string', + 'label' => 'Test', + ); $this->assertEqual($definition, $expected, 'Automatic type fallback on non-string item worked.'); // Simple case, straight metadata. @@ -144,10 +158,10 @@ function testSchemaMapping() { $expected = array(); $expected['label'] = 'Schema multiple filesytem marker test'; $expected['class'] = '\Drupal\Core\Config\Schema\Mapping'; - $expected['mapping']['id']['type'] = 'string'; - $expected['mapping']['id']['label'] = 'ID'; - $expected['mapping']['description']['type'] = 'text'; - $expected['mapping']['description']['label'] = 'Description'; + $expected['mapping']['testid']['type'] = 'string'; + $expected['mapping']['testid']['label'] = 'ID'; + $expected['mapping']['testdescription']['type'] = 'text'; + $expected['mapping']['testdescription']['label'] = 'Description'; $this->assertEqual($definition, $expected, 'Retrieved the right metadata for config_test.someschema.somemodule.section_one.subsection'); diff --git a/core/modules/config/tests/config_test/config/schema/config_test.schema.yml b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml index 6f4ccbe..98f3050 100644 --- a/core/modules/config/tests/config_test/config/schema/config_test.schema.yml +++ b/core/modules/config/tests/config_test/config/schema/config_test.schema.yml @@ -5,13 +5,13 @@ config_test.someschema: label: 'Schema test data' mapping: testitem: - type: text + type: string label: 'Test item' testlist: type: sequence label: 'Test list' sequence: - - type: text + - type: string label: 'Test' config_test.someschema.with_parents: