Chris@0: uuid(); Chris@0: $entity_type_id = $entity->getEntityTypeId(); Chris@0: $original_data = $entity->toArray(); Chris@0: // Copy everything to sync. Chris@0: $this->copyConfig(\Drupal::service('config.storage'), \Drupal::service('config.storage.sync')); Chris@0: // Delete the configuration from active. Don't worry about side effects of Chris@0: // deleting config like fields cleaning up field storages. The coming import Chris@0: // should recreate everything as necessary. Chris@0: $entity->delete(); Chris@0: $this->configImporter()->reset()->import(); Chris@18: $imported_entity = \Drupal::service('entity.repository')->loadEntityByUuid($entity_type_id, $entity_uuid); Chris@0: $this->assertIdentical($original_data, $imported_entity->toArray()); Chris@0: } Chris@0: Chris@0: }