unset($record[$fieldName]);
}
}
+ // Unset values that match the default
+ foreach ($allFields as $fieldName => $field) {
+ if (($record[$fieldName] ?? NULL) === $field['default_value']) {
+ unset($record[$fieldName]);
+ }
+ }
$export = [
'name' => $name,
'entity' => $entityType,
// Should be only name, not id
$this->assertArrayNotHasKey('option_group_id', $export[5]['params']['values']);
// Field with no options
- $this->assertNull($export[6]['params']['values']['option_group_id']);
+ $this->assertTrue(!isset($export[6]['params']['values']['option_group_id']));
$this->assertArrayNotHasKey('option_group_id.name', $export[6]['params']['values']);
$this->assertArrayNotHasKey('option_values', $export[6]['params']['values']);
}
->addChain('export', OptionGroup::export()->setId('$id'))
->execute()->first();
$this->assertEquals('from_email_address', $result['export'][1]['params']['values']['option_group_id.name']);
- $this->assertNull($result['export'][1]['params']['values']['visibility_id']);
+ $this->assertArrayNotHasKey('visibility_id', $result['export'][1]['params']['values']);
$this->assertStringStartsWith('OptionGroup_from_email_address_OptionValue_', $result['export'][1]['name']);
// All references should be from the current domain
foreach (array_slice($result['export'], 1) as $reference) {