// Recreate with the same type - this will have a different UUID.
$content_type = NodeType::
create([ 'type' =>
$type_name,
'name' => 'Node type two',
]);
$content_type->
save();
node_add_body_field($content_type);
$this->configImporter->
reset();
// A node type, a field, an entity view display and an entity form display
// will be recreated.
$creates =
$this->configImporter->
getUnprocessedConfiguration('create'
);
$deletes =
$this->configImporter->
getUnprocessedConfiguration('delete'
);
$this->
assertCount(5,
$creates, 'There are 5 configuration items to create.'
);
$this->
assertCount(5,
$deletes, 'There are 5 configuration items to delete.'
);
$this->
assertCount(0,
$this->configImporter->
getUnprocessedConfiguration('update'
), 'There are no configuration items to update.'
);
$this->
assertSame($creates,
array_reverse($deletes), 'Deletes and creates contain the same configuration names in opposite orders due to dependencies.'
);
$this->configImporter->
import();
// Verify that there is nothing more to import.
$this->
assertFalse($this->configImporter->
reset()->
hasUnprocessedConfigurationChanges());
$content_type = NodeType::
load($type_name);