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