diff --git a/core/modules/field/lib/Drupal/field/Tests/FieldUUIDConflictTest.php b/core/modules/field/lib/Drupal/field/Tests/FieldUUIDConflictTest.php new file mode 100644 index 0000000..adcf0dd --- /dev/null +++ b/core/modules/field/lib/Drupal/field/Tests/FieldUUIDConflictTest.php @@ -0,0 +1,63 @@ + 'UUID conflict', + 'description' => 'Tests staging and importing a field with the same ID but a different UUID.', + 'group' => 'Field API', + ); + } + + /** + * Tests importing an updated field instance. + */ + function testImportChange() { + // $this->drupalPlaceBlock('system_menu_block:menu-tools'); + + // Create a test content type. + $type = (object) array('type' => 'test', 'base' => 'node_content'); + node_type_save($type); + node_types_rebuild(); + node_add_body_field($type); + + $active = $this->container->get('config.storage'); + $field = $active->read('field.field.body'); + $uuid = new Uuid(); + $new_field_uuid = $uuid->generate(); + $field['uuid'] = $new_field_uuid; + + // Save as files in the the staging directory. + $staging = $this->container->get('config.storage.staging'); + $staging->write('field.field.body', $field); + + // Import the content of the staging directory. + config_import(); + + $this->drupalGet(''); + $this->assertResponse(200); + + } + +}