function ConfigSchemaTest::testConfigSaveWithWrappingSchema
Same name in other branches
- 9 core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaTest::testConfigSaveWithWrappingSchema()
- 10 core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaTest::testConfigSaveWithWrappingSchema()
- 11.x core/tests/Drupal/KernelTests/Core/Config/ConfigSchemaTest.php \Drupal\KernelTests\Core\Config\ConfigSchemaTest::testConfigSaveWithWrappingSchema()
Tests saving config when the type is wrapped by a dynamic type.
File
-
core/
tests/ Drupal/ KernelTests/ Core/ Config/ ConfigSchemaTest.php, line 598
Class
- ConfigSchemaTest
- Tests schema for configuration objects.
Namespace
Drupal\KernelTests\Core\ConfigCode
public function testConfigSaveWithWrappingSchema() {
$untyped_values = [
'tests' => [
[
'wrapper_value' => 'foo',
'plugin_id' => 'wrapper:foo',
'internal_value' => 100,
],
],
];
$typed_values = [
'tests' => [
[
'wrapper_value' => 'foo',
'plugin_id' => 'wrapper:foo',
'internal_value' => '100',
],
],
];
// Save config which has a schema that enforces types.
\Drupal::configFactory()->getEditable('wrapping.config_schema_test.plugin_types')
->setData($untyped_values)
->save();
$this->assertIdentical(\Drupal::config('wrapping.config_schema_test.plugin_types')->get(), $typed_values);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.