I have a settings form in my custom module and functional test of this form.
I added new field to form
$form['unblockable_roles'] = [
'#type' => 'checkboxes',
'#title' => $this->t('Users cannot block another users with these roles'),
'#options' => $roles_options,
'#default_value' => $config->get('unblockable_roles') ?: [],
];
Updated schema file:
mymodule.settings:
type: config_object
label: 'My module settings'
mapping:
allowed_roles:
label: 'Allow send messages for these roles'
type: sequence
sequence:
type: string
label: 'Role ID'
unblockable_roles:
label: 'Users cannot block another users with these roles'
type: sequence
sequence:
type: string
label: 'Role ID'
The "config inspector" module has no errors with new field schema, but phpunit says:
"Drupal\Core\Config\Schema\SchemaIncompleteException: Schema errors for mymodule.settings with the following errors: mymodule.settings:unblockable_roles missing schema in Drupal\Core\Config\Development\ConfigSchemaChecker->onConfigSave() (line 94 of core/lib/Drupal/Core/Config/Development/ConfigSchemaChecker.php)."
The same field "allowed_roles" works fine.
I cleared caches, stop-start docker, but without success.
if I use "protected $strictConfigSchema = FALSE;" my test is success. Form values successfully saved.