diff --git a/core/modules/field/src/Tests/DisplayApiTest.php b/core/modules/field/src/Tests/DisplayApiTest.php index 4123ab3..513de0b 100644 --- a/core/modules/field/src/Tests/DisplayApiTest.php +++ b/core/modules/field/src/Tests/DisplayApiTest.php @@ -17,6 +17,15 @@ class DisplayApiTest extends FieldUnitTestBase { /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + + /** * The field name to use in this test. * * @var string diff --git a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php index 939cfc4..1880818 100644 --- a/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php +++ b/core/modules/field/src/Tests/FieldImportDeleteUninstallUiTest.php @@ -19,6 +19,15 @@ class FieldImportDeleteUninstallUiTest extends FieldTestBase { /** + * 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/field/src/Tests/ShapeItemTest.php b/core/modules/field/src/Tests/ShapeItemTest.php index 548d63e..05c1606 100644 --- a/core/modules/field/src/Tests/ShapeItemTest.php +++ b/core/modules/field/src/Tests/ShapeItemTest.php @@ -18,6 +18,15 @@ class ShapeItemTest extends FieldUnitTestBase { /** + * 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/field/src/Tests/TestItemWithDependenciesTest.php b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php index b5ad7e1..684cc0f 100644 --- a/core/modules/field/src/Tests/TestItemWithDependenciesTest.php +++ b/core/modules/field/src/Tests/TestItemWithDependenciesTest.php @@ -15,6 +15,15 @@ class TestItemWithDependenciesTest extends FieldUnitTestBase { /** + * 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/field/tests/modules/field_plugins_test/config/schema/field_plugins_test.schema.yml b/core/modules/field/tests/modules/field_plugins_test/config/schema/field_plugins_test.schema.yml new file mode 100644 index 0000000..a7d58c0 --- /dev/null +++ b/core/modules/field/tests/modules/field_plugins_test/config/schema/field_plugins_test.schema.yml @@ -0,0 +1,7 @@ +field.formatter.settings.field_plugins_test_text_formatter: + type: field.formatter.settings.text_trimmed + label: 'Test text formatter display format settings' + +field.widget.settings.field_plugins_test_text_widget: + type: field.widget.settings.text_textfield + label: 'Test text field widget settings' 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 01b3aa6..0ff333e 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 @@ -1,6 +1,14 @@ +field.formatter.settings.field_test_default: + type: mapping + label: 'Field test default display format settings' + mapping: + test_formatter_setting: + type: string + label: 'Test setting' + field.formatter.settings.field_test_multiple: type: mapping - label: 'field_test display format settings' + label: 'Multiple field test display format settings' mapping: test_formatter_setting_multiple: type: string @@ -9,9 +17,33 @@ field.formatter.settings.field_test_multiple: type: boolean label: 'Test altering' +field.formatter.settings.field_empty_setting: + type: mapping + label: 'Empty setting field display format settings' + mapping: + field_empty_setting: + type: string + label: 'Test setting' + +field.formatter.settings.field_test_with_prepare_view: + type: mapping + label: 'Field prepare step display format settings' + mapping: + test_formatter_setting_additional: + type: string + label: 'Test setting' + +field.widget.settings.test_field_widget: + type: mapping + label: 'Test field widget settings' + mapping: + test_widget_setting: + type: string + label: 'Test setting' + field.widget.settings.test_field_widget_multiple: type: mapping - label: 'field_test display format settings' + label: 'Test multiple field widget settings' mapping: test_widget_setting_multiple: type: string @@ -19,7 +51,7 @@ field.widget.settings.test_field_widget_multiple: field.storage_settings.test_field: type: mapping - label: 'Test field settings' + label: 'Test field storage settings' mapping: test_field_storage_setting: type: string @@ -31,14 +63,30 @@ field.storage_settings.test_field: type: string label: 'An unchangeable field storage setting' +field.storage_settings.test_field_with_dependencies: + type: field.storage_settings.test_field + label: 'Test field with dependencies storage settings' + +field.storage_settings.hidden_test_field: + type: field.storage_settings.test_field + label: 'Hidden test field storage settings' + field.field_settings.test_field: type: mapping - label: 'Test field settings' + label: 'Test field field settings' mapping: test_field_setting: type: string label: 'Test field setting' +field.field_settings.test_field_with_dependencies: + type: field.field_settings.test_field + label: 'Test field with dependencies field settings' + +field.field_settings.hidden_test_field: + type: field.field_settings.test_field + label: 'Hidden test field field settings' + field.value.test_field: type: mapping label: 'Default value' @@ -46,3 +94,11 @@ field.value.test_field: value: type: label label: 'Value' + +entity_view_display.third_party.field_test: + type: mapping + label: 'Field test entity display third party setting' + mapping: + foo: + type: string + label: 'Test setting' diff --git a/core/modules/field_ui/src/Tests/EntityDisplayTest.php b/core/modules/field_ui/src/Tests/EntityDisplayTest.php index 82003d8..efcd9e0 100644 --- a/core/modules/field_ui/src/Tests/EntityDisplayTest.php +++ b/core/modules/field_ui/src/Tests/EntityDisplayTest.php @@ -17,6 +17,15 @@ */ class EntityDisplayTest extends KernelTestBase { + /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + public static $modules = array('field_ui', 'field', 'entity_test', 'user', 'text', 'field_test', 'node', 'system', 'entity_reference'); protected function setUp() { @@ -48,7 +57,7 @@ public function testEntityDisplayCRUD() { $this->assertEqual($display->getComponent('component_2'), $expected['component_2']); // Check that arbitrary options are correctly stored. - $expected['component_3'] = array('weight' => 10, 'foo' => 'bar'); + $expected['component_3'] = array('weight' => 10, 'third_party_settings' => array('field_test' => array('foo' => 'bar'))); $display->setComponent('component_3', $expected['component_3']); $this->assertEqual($display->getComponent('component_3'), $expected['component_3']); diff --git a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php index 057d575..5ce4e9a 100644 --- a/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php +++ b/core/modules/field_ui/src/Tests/EntityFormDisplayTest.php @@ -17,6 +17,15 @@ */ class EntityFormDisplayTest extends KernelTestBase { + /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + public static $modules = array('field_ui', 'field', 'entity_test', 'field_test', 'user', 'text', 'entity_reference'); protected function setUp() { diff --git a/core/modules/field_ui/src/Tests/ManageDisplayTest.php b/core/modules/field_ui/src/Tests/ManageDisplayTest.php index d0edeef..5c8e276 100644 --- a/core/modules/field_ui/src/Tests/ManageDisplayTest.php +++ b/core/modules/field_ui/src/Tests/ManageDisplayTest.php @@ -8,7 +8,6 @@ namespace Drupal\field_ui\Tests; use Drupal\Component\Utility\Unicode; -use Drupal\config\Tests\SchemaCheckTestTrait; use Drupal\Core\Entity\EntityInterface; use Drupal\Core\Language\LanguageInterface; use Drupal\simpletest\WebTestBase; @@ -20,7 +19,15 @@ */ class ManageDisplayTest extends WebTestBase { - use SchemaCheckTestTrait; + /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + use FieldUiTestTrait; /** @@ -141,7 +148,6 @@ function testFormatterUI() { $display = entity_load('entity_view_display', 'node.' . $this->type . '.default', TRUE); $this->assertEqual($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_field_formatter_third_party_settings_form'), 'foo'); $this->assertTrue(in_array('field_third_party_test', $display->calculateDependencies()['module']), 'The display has a dependency on field_third_party_test module.'); - $this->assertConfigSchema(\Drupal::service('config.typed'), $display->getEntityType()->getConfigPrefix() . '.' . $display->id(), $display->toArray()); // Confirm that the third party settings are not updated on the settings form. $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); @@ -248,7 +254,6 @@ public function testWidgetUI() { $display = entity_load('entity_form_display', 'node.' . $this->type . '.default', TRUE); $this->assertEqual($display->getRenderer('field_test')->getThirdPartySetting('field_third_party_test', 'field_test_widget_third_party_settings_form'), 'foo'); $this->assertTrue(in_array('field_third_party_test', $display->calculateDependencies()['module']), 'Form display does not have a dependency on field_third_party_test module.'); - $this->assertConfigSchema(\Drupal::service('config.typed'), $display->getEntityType()->getConfigPrefix() . '.' . $display->id(), $display->toArray()); // Confirm that the third party settings are not updated on the settings form. $this->drupalPostAjaxForm(NULL, array(), "field_test_settings_edit"); diff --git a/core/modules/field_ui/src/Tests/ManageFieldsTest.php b/core/modules/field_ui/src/Tests/ManageFieldsTest.php index 955034c..44f1949 100644 --- a/core/modules/field_ui/src/Tests/ManageFieldsTest.php +++ b/core/modules/field_ui/src/Tests/ManageFieldsTest.php @@ -21,6 +21,15 @@ */ class ManageFieldsTest extends WebTestBase { + /** + * Set to TRUE to strict check all configuration saved. + * + * @see \Drupal\Core\Config\Testing\ConfigSchemaChecker + * + * @var bool + */ + protected $strictConfigSchema = TRUE; + use FieldUiTestTrait; /** diff --git a/core/modules/link/config/schema/link.schema.yml b/core/modules/link/config/schema/link.schema.yml index d489174..01a8a65 100644 --- a/core/modules/link/config/schema/link.schema.yml +++ b/core/modules/link/config/schema/link.schema.yml @@ -21,18 +21,8 @@ field.formatter.settings.link: label: 'Open link in new window' field.formatter.settings.link_separate: - type: mapping + type: field.formatter.settings.link label: 'Link format settings' - mapping: - trim_length: - type: integer - label: 'Trim link text length' - rel: - type: string - label: 'Add rel="nofollow" to links' - target: - type: string - label: 'Open link in new window' field.widget.settings.link_default: type: mapping diff --git a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php index c88b8ff..3642a1f 100644 --- a/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php +++ b/core/modules/link/src/Plugin/Field/FieldFormatter/LinkSeparateFormatter.php @@ -33,7 +33,7 @@ class LinkSeparateFormatter extends LinkFormatter { */ public static function defaultSettings() { return array( - 'trim_length' => '80', + 'trim_length' => 80, 'rel' => '', 'target' => '', ) + parent::defaultSettings(); diff --git a/core/modules/link/src/Tests/LinkFieldTest.php b/core/modules/link/src/Tests/LinkFieldTest.php index 97058f0..685b145 100644 --- a/core/modules/link/src/Tests/LinkFieldTest.php +++ b/core/modules/link/src/Tests/LinkFieldTest.php @@ -21,6 +21,15 @@ class LinkFieldTest extends WebTestBase { /** + * 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/simpletest/src/TestBase.php b/core/modules/simpletest/src/TestBase.php index a766d63..806281e 100644 --- a/core/modules/simpletest/src/TestBase.php +++ b/core/modules/simpletest/src/TestBase.php @@ -209,7 +209,7 @@ * * @var bool */ - protected $strictConfigSchema = FALSE; + protected $strictConfigSchema = TRUE; /** * Constructor for Test. diff --git a/core/modules/system/tests/modules/entity_test/config/schema/entity_test.schema.yml b/core/modules/system/tests/modules/entity_test/config/schema/entity_test.schema.yml index 85a19e8..5a3ad02 100644 --- a/core/modules/system/tests/modules/entity_test/config/schema/entity_test.schema.yml +++ b/core/modules/system/tests/modules/entity_test/config/schema/entity_test.schema.yml @@ -5,3 +5,11 @@ entity_view_display.third_party.entity_test: foo: type: string label: 'Label for foo' + +field.storage_settings.shape: + type: mapping + label: 'Shape field storage settings' + mapping: + foreign_key_name: + type: string + label: 'Foreign key name'