Merge pull request #14857 from colemanw/testFormat
[civicrm-core.git] / tests / phpunit / CRM / Dedupe / BAO / RuleGroupTest.php
1 <?php
2
3 /**
4 * Class CRM_Dedupe_BAO_RuleGroupTest
5 * @group headless
6 */
7 class CRM_Dedupe_BAO_RuleGroupTest extends CiviUnitTestCase {
8
9 /**
10 * Test that sort_name is included in supported fields.
11 *
12 * This feels like kind of a brittle test but since I debated actually making it
13 * importable in the schema & bottled out at least some degree of test support
14 * to ensure the field remains 'hacked in' seems important.
15 *
16 * This will at least surface any changes that affect this function.
17 *
18 * In general we do have a bit of a problem with having overloaded the meaning of
19 * importable & exportable fields.
20 */
21 public function testSupportedFields() {
22 $fields = CRM_Dedupe_BAO_RuleGroup::supportedFields('Organization');
23
24 $this->assertEquals([
25 'civicrm_address' =>
26 [
27 'name' => 'Address Name',
28 'city' => 'City',
29 'country_id' => 'Country',
30 'county_id' => 'County',
31 'geo_code_1' => 'Latitude',
32 'geo_code_2' => 'Longitude',
33 'master_id' => 'Master Address Belongs To',
34 'postal_code' => 'Postal Code',
35 'postal_code_suffix' => 'Postal Code Suffix',
36 'state_province_id' => 'State',
37 'street_address' => 'Street Address',
38 'supplemental_address_1' => 'Supplemental Address 1',
39 'supplemental_address_2' => 'Supplemental Address 2',
40 'supplemental_address_3' => 'Supplemental Address 3',
41 ],
42 'civicrm_contact' =>
43 [
44 'addressee_id' => 'Addressee',
45 'addressee_custom' => 'Addressee Custom',
46 'id' => 'Contact ID',
47 'source' => 'Contact Source',
48 'contact_sub_type' => 'Contact Subtype',
49 'do_not_email' => 'Do Not Email',
50 'do_not_mail' => 'Do Not Mail',
51 'do_not_phone' => 'Do Not Phone',
52 'do_not_sms' => 'Do Not Sms',
53 'do_not_trade' => 'Do Not Trade',
54 'email_greeting_id' => 'Email Greeting',
55 'email_greeting_custom' => 'Email Greeting Custom',
56 'external_identifier' => 'External Identifier',
57 'image_URL' => 'Image Url',
58 'legal_identifier' => 'Legal Identifier',
59 'legal_name' => 'Legal Name',
60 'nick_name' => 'Nickname',
61 'is_opt_out' => 'No Bulk Emails (User Opt Out)',
62 'organization_name' => 'Organization Name',
63 'postal_greeting_id' => 'Postal Greeting',
64 'postal_greeting_custom' => 'Postal Greeting Custom',
65 'preferred_communication_method' => 'Preferred Communication Method',
66 'preferred_language' => 'Preferred Language',
67 'preferred_mail_format' => 'Preferred Mail Format',
68 'sic_code' => 'Sic Code',
69 'user_unique_id' => 'Unique ID (OpenID)',
70 'sort_name' => 'Sort Name',
71 ],
72 'civicrm_email' =>
73 [
74 'email' => 'Email',
75 'signature_html' => 'Signature Html',
76 'signature_text' => 'Signature Text',
77 ],
78 'civicrm_im' =>
79 [
80 'name' => 'IM Screen Name',
81 ],
82 'civicrm_note' =>
83 [
84 'note' => 'Note',
85 ],
86 'civicrm_openid' =>
87 [
88 'openid' => 'OpenID',
89 ],
90 'civicrm_phone' =>
91 [
92 'phone_numeric' => 'Phone',
93 'phone_ext' => 'Phone Extension',
94 ],
95 ], $fields);
96 }
97
98 }