diff --git a/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php b/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php index db80944..cf5f113 100644 --- a/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php +++ b/core/lib/Drupal/Core/Config/Testing/ConfigSchemaChecker.php @@ -66,7 +66,9 @@ public function onConfigSave(ConfigCrudEvent $event) { $name = $saved_config->getName(); $data = $saved_config->get(); $checksum = crc32(serialize($data)); - if (!isset($this->checked[$name . ':' . $checksum])) { + // Content translation settings cannot be provided schema yet, see + // https://www.drupal.org/node/2363155 + if ($name != 'content_translation.settings' && !isset($this->checked[$name . ':' . $checksum])) { $this->checked[$name . ':' . $checksum] = TRUE; $errors = $this->checkConfigSchema($this->typedManager, $name, $data); if ($errors === FALSE) { diff --git a/core/modules/block/src/Tests/Views/DisplayBlockTest.php b/core/modules/block/src/Tests/Views/DisplayBlockTest.php index 37b8b60..02b1d91 100644 --- a/core/modules/block/src/Tests/Views/DisplayBlockTest.php +++ b/core/modules/block/src/Tests/Views/DisplayBlockTest.php @@ -23,6 +23,15 @@ class DisplayBlockTest extends ViewTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml index c8f6b67..e720e2b 100644 --- a/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml +++ b/core/modules/block/tests/modules/block_test_views/test_views/views.view.test_view_block.yml @@ -46,7 +46,7 @@ display: display_title: Block position: null display_options: - field: + fields: title: link_to_node: true field_langcode: '***LANGUAGE_language_content***' diff --git a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php index 1ea2156..c6e3d3f 100644 --- a/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php +++ b/core/modules/block_content/src/Tests/BlockContentCacheTagsTest.php @@ -19,6 +19,15 @@ class BlockContentCacheTagsTest extends EntityCacheTagsTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * {@inheritdoc} */ public static $modules = array('block_content'); diff --git a/core/modules/block_content/src/Tests/BlockContentFieldTest.php b/core/modules/block_content/src/Tests/BlockContentFieldTest.php index 4fc7bf6..26d921a 100644 --- a/core/modules/block_content/src/Tests/BlockContentFieldTest.php +++ b/core/modules/block_content/src/Tests/BlockContentFieldTest.php @@ -18,6 +18,15 @@ class BlockContentFieldTest extends BlockContentTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * Modules to enable. * * @var array diff --git a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php index 74fc537..8e3a0e7 100644 --- a/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php +++ b/core/modules/block_content/src/Tests/BlockContentTranslationUITest.php @@ -18,6 +18,16 @@ class BlockContentTranslationUITest extends ContentTranslationUITest { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + + /** * Modules to enable. * * @var array diff --git a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php index ea28195..fa7488a 100644 --- a/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php +++ b/core/modules/content_translation/src/Tests/ContentTranslationSettingsTest.php @@ -8,7 +8,6 @@ namespace Drupal\content_translation\Tests; use Drupal\comment\Plugin\Field\FieldType\CommentItemInterface; -use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\Core\Field\Entity\BaseFieldOverride; use Drupal\Core\Language\Language; use Drupal\field\Entity\FieldConfig; @@ -21,7 +20,14 @@ */ class ContentTranslationSettingsTest extends WebTestBase { - use SchemaCheckTestTrait; + /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; /** * Modules to enable. @@ -181,8 +187,6 @@ function testSettingsUI() { $this->assertEqual($definitions['body']->isTranslatable(), $translatable, 'Field translatability correctly switched.'); $this->assertEqual($field->isTranslatable(), $definitions['body']->isTranslatable(), 'Configurable field translatability correctly switched.'); } - - $this->assertConfigSchemas(); } /** @@ -274,22 +278,4 @@ protected function entityManager() { return $this->container->get('entity.manager'); } - /** - * Asserts all active configuration matches schemas. - */ - protected function assertConfigSchemas() { - $names = $this->container->get('config.storage')->listAll(); - $factory = $this->container->get('config.factory'); - /** @var \Drupal\Core\Config\TypedConfigManagerInterface $typed_config */ - $typed_config = $this->container->get('config.typed'); - foreach ($names as $name) { - // It is not possible to provide schema due to https://www.drupal.org/node/2248709 - // @todo Refactor settings in https://www.drupal.org/node/2363155 - if ($name != 'content_translation.settings') { - $config = $factory->get($name); - $this->assertConfigSchema($typed_config, $name, $config->get()); - } - } - } - } diff --git a/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml b/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml index 6edc8f5..01b3aa6 100644 --- a/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml +++ b/core/modules/field/tests/modules/field_test/config/schema/field_test.schema.yml @@ -16,3 +16,33 @@ field.widget.settings.test_field_widget_multiple: test_widget_setting_multiple: type: string label: 'Test setting' + +field.storage_settings.test_field: + type: mapping + label: 'Test field settings' + mapping: + test_field_storage_setting: + type: string + label: 'Test field storage setting' + changeable: + type: string + label: 'A changeable field storage setting' + unchangeable: + type: string + label: 'An unchangeable field storage setting' + +field.field_settings.test_field: + type: mapping + label: 'Test field settings' + mapping: + test_field_setting: + type: string + label: 'Test field setting' + +field.value.test_field: + type: mapping + label: 'Default value' + mapping: + value: + type: label + label: 'Value' diff --git a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php index ba79e7d..456f911 100644 --- a/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php +++ b/core/modules/field/tests/modules/field_test/src/Plugin/Field/FieldType/TestItem.php @@ -42,7 +42,6 @@ public static function defaultStorageSettings() { public static function defaultFieldSettings() { return array( 'test_field_setting' => 'dummy test string', - 'test_cached_data' => FALSE, ) + parent::defaultFieldSettings(); } diff --git a/core/modules/link/config/schema/link.schema.yml b/core/modules/link/config/schema/link.schema.yml index 2a33347..676016a 100644 --- a/core/modules/link/config/schema/link.schema.yml +++ b/core/modules/link/config/schema/link.schema.yml @@ -44,3 +44,29 @@ field.widget.settings.link_default: placeholder_title: type: label label: 'Placeholder for link text' + +field.storage_settings.link: + type: mapping + label: 'Link settings' + +field.field_settings.link: + type: mapping + label: 'Link settings' + mapping: + title: + type: integer + label: 'Allow link text' + link_type: + type: integer + label: 'Allowed link type' + +field.link.value: + type: mapping + label: 'Default value' + mapping: + title: + type: label + label: 'Link text' + url: + type: string + label: 'URL'