Merge pull request #5047 from colemanw/CRM-15898
[civicrm-core.git] / api / v3 / examples / Contact / GetFieldsOptions.php
1 <?php
2 /**
3 * @file
4 * Test Generated API Example.
5 * See bottom of this file for more detail.
6 */
7
8 /**
9 * Test Generated example of using contact GetFields API.
10 *
11 * Demonstrate retrieving metadata with custom field options
12 *
13 * @return array
14 * API result array
15 */
16 function contact_getfields_example() {
17 $params = array(
18 'options' => array(
19 'get_options' => 'custom_1',
20 ),
21 'action' => 'create',
22 );
23
24 try{
25 $result = civicrm_api3('contact', 'GetFields', $params);
26 }
27 catch (CiviCRM_API3_Exception $e) {
28 // Handle error here.
29 $errorMessage = $e->getMessage();
30 $errorCode = $e->getErrorCode();
31 $errorData = $e->getExtraParams();
32 return array(
33 'error' => $errorMessage,
34 'error_code' => $errorCode,
35 'error_data' => $errorData,
36 );
37 }
38
39 return $result;
40 }
41
42 /**
43 * Function returns array of result expected from previous function.
44 *
45 * @return array
46 * API result array
47 */
48 function contact_getfields_expectedresult() {
49
50 $expectedResult = array(
51 'is_error' => 0,
52 'version' => 3,
53 'count' => 55,
54 'values' => array(
55 'id' => array(
56 'name' => 'id',
57 'type' => 1,
58 'title' => 'Internal Contact ID',
59 'required' => TRUE,
60 'import' => TRUE,
61 'where' => 'civicrm_contact.id',
62 'headerPattern' => '/internal|contact?|id$/i',
63 'export' => TRUE,
64 'api.aliases' => array(
65 '0' => 'contact_id',
66 ),
67 ),
68 'contact_type' => array(
69 'name' => 'contact_type',
70 'type' => 2,
71 'title' => 'Contact Type',
72 'maxlength' => 64,
73 'size' => 30,
74 'export' => TRUE,
75 'where' => 'civicrm_contact.contact_type',
76 'html' => array(
77 'type' => 'Select',
78 ),
79 'pseudoconstant' => array(
80 'table' => 'civicrm_contact_type',
81 'keyColumn' => 'name',
82 'labelColumn' => 'label',
83 'condition' => 'parent_id IS NULL',
84 ),
85 'api.required' => 1,
86 ),
87 'contact_sub_type' => array(
88 'name' => 'contact_sub_type',
89 'type' => 2,
90 'title' => 'Contact Subtype',
91 'maxlength' => 255,
92 'size' => 45,
93 'import' => TRUE,
94 'where' => 'civicrm_contact.contact_sub_type',
95 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
96 'export' => TRUE,
97 'html' => array(
98 'type' => 'Multi-Select',
99 ),
100 'pseudoconstant' => array(
101 'table' => 'civicrm_contact_type',
102 'keyColumn' => 'name',
103 'labelColumn' => 'label',
104 'condition' => 'parent_id IS NOT NULL',
105 ),
106 ),
107 'do_not_email' => array(
108 'name' => 'do_not_email',
109 'type' => 16,
110 'title' => 'Do Not Email',
111 'import' => TRUE,
112 'where' => 'civicrm_contact.do_not_email',
113 'headerPattern' => '/d(o )?(not )?(email)/i',
114 'dataPattern' => '/^\\d{1,}$/',
115 'export' => TRUE,
116 'html' => array(
117 'type' => 'CheckBox',
118 ),
119 ),
120 'do_not_phone' => array(
121 'name' => 'do_not_phone',
122 'type' => 16,
123 'title' => 'Do Not Phone',
124 'import' => TRUE,
125 'where' => 'civicrm_contact.do_not_phone',
126 'headerPattern' => '/d(o )?(not )?(call|phone)/i',
127 'dataPattern' => '/^\\d{1,}$/',
128 'export' => TRUE,
129 'html' => array(
130 'type' => 'CheckBox',
131 ),
132 ),
133 'do_not_mail' => array(
134 'name' => 'do_not_mail',
135 'type' => 16,
136 'title' => 'Do Not Mail',
137 'import' => TRUE,
138 'where' => 'civicrm_contact.do_not_mail',
139 'headerPattern' => '/^(d(o\\s)?n(ot\\s)?mail)|(\\w*)?bulk\\s?(\\w*)$/i',
140 'dataPattern' => '/^\\d{1,}$/',
141 'export' => TRUE,
142 'html' => array(
143 'type' => 'CheckBox',
144 ),
145 ),
146 'do_not_sms' => array(
147 'name' => 'do_not_sms',
148 'type' => 16,
149 'title' => 'Do Not Sms',
150 'import' => TRUE,
151 'where' => 'civicrm_contact.do_not_sms',
152 'headerPattern' => '/d(o )?(not )?(sms)/i',
153 'dataPattern' => '/^\\d{1,}$/',
154 'export' => TRUE,
155 'html' => array(
156 'type' => 'CheckBox',
157 ),
158 ),
159 'do_not_trade' => array(
160 'name' => 'do_not_trade',
161 'type' => 16,
162 'title' => 'Do Not Trade',
163 'import' => TRUE,
164 'where' => 'civicrm_contact.do_not_trade',
165 'headerPattern' => '/d(o )?(not )?(trade)/i',
166 'dataPattern' => '/^\\d{1,}$/',
167 'export' => TRUE,
168 'html' => array(
169 'type' => 'CheckBox',
170 ),
171 ),
172 'is_opt_out' => array(
173 'name' => 'is_opt_out',
174 'type' => 16,
175 'title' => 'No Bulk Emails (User Opt Out)',
176 'required' => TRUE,
177 'import' => TRUE,
178 'where' => 'civicrm_contact.is_opt_out',
179 'export' => TRUE,
180 'html' => array(
181 'type' => 'CheckBox',
182 ),
183 ),
184 'legal_identifier' => array(
185 'name' => 'legal_identifier',
186 'type' => 2,
187 'title' => 'Legal Identifier',
188 'maxlength' => 32,
189 'size' => 20,
190 'import' => TRUE,
191 'where' => 'civicrm_contact.legal_identifier',
192 'headerPattern' => '/legal\\s?id/i',
193 'dataPattern' => '/\\w+?\\d{5,}/',
194 'export' => TRUE,
195 'html' => array(
196 'type' => 'Text',
197 ),
198 ),
199 'external_identifier' => array(
200 'name' => 'external_identifier',
201 'type' => 2,
202 'title' => 'External Identifier',
203 'maxlength' => 32,
204 'size' => 8,
205 'import' => TRUE,
206 'where' => 'civicrm_contact.external_identifier',
207 'headerPattern' => '/external\\s?id/i',
208 'dataPattern' => '/^\\d{11,}$/',
209 'export' => TRUE,
210 'html' => array(
211 'type' => 'Text',
212 ),
213 ),
214 'sort_name' => array(
215 'name' => 'sort_name',
216 'type' => 2,
217 'title' => 'Sort Name',
218 'maxlength' => 128,
219 'size' => 30,
220 'export' => TRUE,
221 'where' => 'civicrm_contact.sort_name',
222 'html' => array(
223 'type' => 'Text',
224 ),
225 ),
226 'display_name' => array(
227 'name' => 'display_name',
228 'type' => 2,
229 'title' => 'Display Name',
230 'maxlength' => 128,
231 'size' => 30,
232 'export' => TRUE,
233 'where' => 'civicrm_contact.display_name',
234 'html' => array(
235 'type' => 'Text',
236 ),
237 ),
238 'nick_name' => array(
239 'name' => 'nick_name',
240 'type' => 2,
241 'title' => 'Nickname',
242 'maxlength' => 128,
243 'size' => 30,
244 'import' => TRUE,
245 'where' => 'civicrm_contact.nick_name',
246 'headerPattern' => '/n(ick\\s)name|nick$/i',
247 'dataPattern' => '/^\\w+$/',
248 'export' => TRUE,
249 'html' => array(
250 'type' => 'Text',
251 ),
252 ),
253 'legal_name' => array(
254 'name' => 'legal_name',
255 'type' => 2,
256 'title' => 'Legal Name',
257 'maxlength' => 128,
258 'size' => 30,
259 'import' => TRUE,
260 'where' => 'civicrm_contact.legal_name',
261 'headerPattern' => '/^legal|(l(egal\\s)?name)$/i',
262 'export' => TRUE,
263 'html' => array(
264 'type' => 'Text',
265 ),
266 ),
267 'image_URL' => array(
268 'name' => 'image_URL',
269 'type' => 2,
270 'title' => 'Image Url',
271 'maxlength' => 255,
272 'size' => 45,
273 'import' => TRUE,
274 'where' => 'civicrm_contact.image_URL',
275 'export' => TRUE,
276 'html' => array(
277 'type' => 'Text',
278 ),
279 ),
280 'preferred_communication_method' => array(
281 'name' => 'preferred_communication_method',
282 'type' => 2,
283 'title' => 'Preferred Communication Method',
284 'maxlength' => 255,
285 'size' => 45,
286 'import' => TRUE,
287 'where' => 'civicrm_contact.preferred_communication_method',
288 'headerPattern' => '/^p(ref\\w*\\s)?c(omm\\w*)|( meth\\w*)$/i',
289 'dataPattern' => '/^\\w+$/',
290 'export' => TRUE,
291 'html' => array(
292 'type' => 'Select',
293 ),
294 'pseudoconstant' => array(
295 'optionGroupName' => 'preferred_communication_method',
296 ),
297 ),
298 'preferred_language' => array(
299 'name' => 'preferred_language',
300 'type' => 2,
301 'title' => 'Preferred Language',
302 'maxlength' => 5,
303 'size' => 6,
304 'import' => TRUE,
305 'where' => 'civicrm_contact.preferred_language',
306 'headerPattern' => '/^lang/i',
307 'export' => TRUE,
308 'html' => array(
309 'type' => 'Select',
310 ),
311 'pseudoconstant' => array(
312 'optionGroupName' => 'languages',
313 'keyColumn' => 'name',
314 ),
315 ),
316 'preferred_mail_format' => array(
317 'name' => 'preferred_mail_format',
318 'type' => 2,
319 'title' => 'Preferred Mail Format',
320 'maxlength' => 8,
321 'size' => 8,
322 'import' => TRUE,
323 'where' => 'civicrm_contact.preferred_mail_format',
324 'headerPattern' => '/^p(ref\\w*\\s)?m(ail\\s)?f(orm\\w*)$/i',
325 'export' => TRUE,
326 'default' => 'Both',
327 'html' => array(
328 'type' => 'Select',
329 ),
330 'pseudoconstant' => array(
331 'callback' => 'CRM_Core_SelectValues::pmf',
332 ),
333 ),
334 'hash' => array(
335 'name' => 'hash',
336 'type' => 2,
337 'title' => 'Contact Hash',
338 'maxlength' => 32,
339 'size' => 20,
340 'export' => TRUE,
341 'where' => 'civicrm_contact.hash',
342 ),
343 'api_key' => array(
344 'name' => 'api_key',
345 'type' => 2,
346 'title' => 'Api Key',
347 'maxlength' => 32,
348 'size' => 20,
349 ),
350 'first_name' => array(
351 'name' => 'first_name',
352 'type' => 2,
353 'title' => 'First Name',
354 'maxlength' => 64,
355 'size' => 30,
356 'import' => TRUE,
357 'where' => 'civicrm_contact.first_name',
358 'headerPattern' => '/^first|(f(irst\\s)?name)$/i',
359 'dataPattern' => '/^\\w+$/',
360 'export' => TRUE,
361 'html' => array(
362 'type' => 'Text',
363 ),
364 ),
365 'middle_name' => array(
366 'name' => 'middle_name',
367 'type' => 2,
368 'title' => 'Middle Name',
369 'maxlength' => 64,
370 'size' => 20,
371 'import' => TRUE,
372 'where' => 'civicrm_contact.middle_name',
373 'headerPattern' => '/^middle|(m(iddle\\s)?name)$/i',
374 'dataPattern' => '/^\\w+$/',
375 'export' => TRUE,
376 'html' => array(
377 'type' => 'Text',
378 ),
379 ),
380 'last_name' => array(
381 'name' => 'last_name',
382 'type' => 2,
383 'title' => 'Last Name',
384 'maxlength' => 64,
385 'size' => 30,
386 'import' => TRUE,
387 'where' => 'civicrm_contact.last_name',
388 'headerPattern' => '/^last|(l(ast\\s)?name)$/i',
389 'dataPattern' => '/^\\w+(\\s\\w+)?+$/',
390 'export' => TRUE,
391 'html' => array(
392 'type' => 'Text',
393 ),
394 ),
395 'prefix_id' => array(
396 'name' => 'prefix_id',
397 'type' => 1,
398 'title' => 'Individual Prefix',
399 'import' => TRUE,
400 'where' => 'civicrm_contact.prefix_id',
401 'headerPattern' => '/^(prefix|title)/i',
402 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\\.?$/i',
403 'export' => TRUE,
404 'html' => array(
405 'type' => 'Select',
406 ),
407 'pseudoconstant' => array(
408 'optionGroupName' => 'individual_prefix',
409 ),
410 'api.aliases' => array(
411 '0' => 'individual_prefix',
412 '1' => 'individual_prefix_id',
413 ),
414 ),
415 'suffix_id' => array(
416 'name' => 'suffix_id',
417 'type' => 1,
418 'title' => 'Individual Suffix',
419 'import' => TRUE,
420 'where' => 'civicrm_contact.suffix_id',
421 'headerPattern' => '/^suffix$/i',
422 'dataPattern' => '/^(sr|jr)\\.?|i{2,}$/',
423 'export' => TRUE,
424 'html' => array(
425 'type' => 'Select',
426 ),
427 'pseudoconstant' => array(
428 'optionGroupName' => 'individual_suffix',
429 ),
430 'api.aliases' => array(
431 '0' => 'individual_suffix',
432 '1' => 'individual_suffix_id',
433 ),
434 ),
435 'formal_title' => array(
436 'name' => 'formal_title',
437 'type' => 2,
438 'title' => 'Formal Title',
439 'maxlength' => 64,
440 'size' => 30,
441 'import' => TRUE,
442 'where' => 'civicrm_contact.formal_title',
443 'headerPattern' => '/^title/i',
444 'export' => TRUE,
445 ),
446 'communication_style_id' => array(
447 'name' => 'communication_style_id',
448 'type' => 1,
449 'title' => 'Communication Style',
450 'export' => TRUE,
451 'where' => 'civicrm_contact.communication_style_id',
452 'pseudoconstant' => array(
453 'optionGroupName' => 'communication_style',
454 ),
455 ),
456 'email_greeting_id' => array(
457 'name' => 'email_greeting_id',
458 'type' => 1,
459 'title' => 'Email Greeting ID',
460 ),
461 'email_greeting_custom' => array(
462 'name' => 'email_greeting_custom',
463 'type' => 2,
464 'title' => 'Email Greeting Custom',
465 'maxlength' => 128,
466 'size' => 45,
467 'import' => TRUE,
468 'where' => 'civicrm_contact.email_greeting_custom',
469 'html' => array(
470 'type' => 'Text',
471 ),
472 ),
473 'email_greeting_display' => array(
474 'name' => 'email_greeting_display',
475 'type' => 2,
476 'title' => 'Email Greeting',
477 'maxlength' => 255,
478 'size' => 45,
479 'html' => array(
480 'type' => 'Text',
481 ),
482 ),
483 'postal_greeting_id' => array(
484 'name' => 'postal_greeting_id',
485 'type' => 1,
486 'title' => 'Postal Greeting ID',
487 'html' => array(
488 'type' => 'Text',
489 ),
490 ),
491 'postal_greeting_custom' => array(
492 'name' => 'postal_greeting_custom',
493 'type' => 2,
494 'title' => 'Postal Greeting Custom',
495 'maxlength' => 128,
496 'size' => 45,
497 'import' => TRUE,
498 'where' => 'civicrm_contact.postal_greeting_custom',
499 'html' => array(
500 'type' => 'Text',
501 ),
502 ),
503 'postal_greeting_display' => array(
504 'name' => 'postal_greeting_display',
505 'type' => 2,
506 'title' => 'Postal Greeting',
507 'maxlength' => 255,
508 'size' => 45,
509 'html' => array(
510 'type' => 'Text',
511 ),
512 ),
513 'addressee_id' => array(
514 'name' => 'addressee_id',
515 'type' => 1,
516 'title' => 'Addressee ID',
517 ),
518 'addressee_custom' => array(
519 'name' => 'addressee_custom',
520 'type' => 2,
521 'title' => 'Addressee Custom',
522 'maxlength' => 128,
523 'size' => 45,
524 'import' => TRUE,
525 'where' => 'civicrm_contact.addressee_custom',
526 'html' => array(
527 'type' => 'Text',
528 ),
529 ),
530 'addressee_display' => array(
531 'name' => 'addressee_display',
532 'type' => 2,
533 'title' => 'Addressee',
534 'maxlength' => 255,
535 'size' => 45,
536 'html' => array(
537 'type' => 'Text',
538 ),
539 ),
540 'job_title' => array(
541 'name' => 'job_title',
542 'type' => 2,
543 'title' => 'Job Title',
544 'maxlength' => 255,
545 'size' => 20,
546 'import' => TRUE,
547 'where' => 'civicrm_contact.job_title',
548 'headerPattern' => '/^job|(j(ob\\s)?title)$/i',
549 'dataPattern' => '//',
550 'export' => TRUE,
551 'html' => array(
552 'type' => 'Text',
553 ),
554 ),
555 'gender_id' => array(
556 'name' => 'gender_id',
557 'type' => 1,
558 'title' => 'Gender',
559 'import' => TRUE,
560 'where' => 'civicrm_contact.gender_id',
561 'headerPattern' => '/^gender$/i',
562 'export' => TRUE,
563 'html' => array(
564 'type' => 'Select',
565 ),
566 'pseudoconstant' => array(
567 'optionGroupName' => 'gender',
568 ),
569 ),
570 'birth_date' => array(
571 'name' => 'birth_date',
572 'type' => 4,
573 'title' => 'Birth Date',
574 'import' => TRUE,
575 'where' => 'civicrm_contact.birth_date',
576 'headerPattern' => '/^birth|(b(irth\\s)?date)|D(\\W*)O(\\W*)B(\\W*)$/i',
577 'dataPattern' => '/\\d{4}-?\\d{2}-?\\d{2}/',
578 'export' => TRUE,
579 'html' => array(
580 'type' => 'Select Date',
581 ),
582 ),
583 'is_deceased' => array(
584 'name' => 'is_deceased',
585 'type' => 16,
586 'title' => 'Is Deceased',
587 'import' => TRUE,
588 'where' => 'civicrm_contact.is_deceased',
589 'headerPattern' => '/i(s\\s)?d(eceased)$/i',
590 'export' => TRUE,
591 'html' => array(
592 'type' => 'CheckBox',
593 ),
594 ),
595 'deceased_date' => array(
596 'name' => 'deceased_date',
597 'type' => 4,
598 'title' => 'Deceased Date',
599 'import' => TRUE,
600 'where' => 'civicrm_contact.deceased_date',
601 'headerPattern' => '/^deceased|(d(eceased\\s)?date)$/i',
602 'export' => TRUE,
603 'html' => array(
604 'type' => 'Select Date',
605 ),
606 ),
607 'household_name' => array(
608 'name' => 'household_name',
609 'type' => 2,
610 'title' => 'Household Name',
611 'maxlength' => 128,
612 'size' => 30,
613 'import' => TRUE,
614 'where' => 'civicrm_contact.household_name',
615 'headerPattern' => '/^household|(h(ousehold\\s)?name)$/i',
616 'dataPattern' => '/^\\w+$/',
617 'export' => TRUE,
618 'html' => array(
619 'type' => 'Text',
620 ),
621 ),
622 'primary_contact_id' => array(
623 'name' => 'primary_contact_id',
624 'type' => 1,
625 'title' => 'Household Primary Contact ID',
626 'FKClassName' => 'CRM_Contact_DAO_Contact',
627 'html' => array(
628 'type' => 'Select',
629 ),
630 'FKApiName' => 'Contact',
631 ),
632 'organization_name' => array(
633 'name' => 'organization_name',
634 'type' => 2,
635 'title' => 'Organization Name',
636 'maxlength' => 128,
637 'size' => 30,
638 'import' => TRUE,
639 'where' => 'civicrm_contact.organization_name',
640 'headerPattern' => '/^organization|(o(rganization\\s)?name)$/i',
641 'dataPattern' => '/^\\w+$/',
642 'export' => TRUE,
643 'html' => array(
644 'type' => 'Text',
645 ),
646 ),
647 'sic_code' => array(
648 'name' => 'sic_code',
649 'type' => 2,
650 'title' => 'Sic Code',
651 'maxlength' => 8,
652 'size' => 8,
653 'import' => TRUE,
654 'where' => 'civicrm_contact.sic_code',
655 'headerPattern' => '/^sic|(s(ic\\s)?code)$/i',
656 'export' => TRUE,
657 'html' => array(
658 'type' => 'Text',
659 ),
660 ),
661 'user_unique_id' => array(
662 'name' => 'user_unique_id',
663 'type' => 2,
664 'title' => 'Unique ID (OpenID)',
665 'maxlength' => 255,
666 'size' => 45,
667 'import' => TRUE,
668 'where' => 'civicrm_contact.user_unique_id',
669 'headerPattern' => '/^Open\\s?ID|u(niq\\w*)?\\s?ID/i',
670 'dataPattern' => '/^[\\w\\/\\:\\.]+$/',
671 'export' => TRUE,
672 'rule' => 'url',
673 'html' => array(
674 'type' => 'Text',
675 ),
676 ),
677 'created_date' => array(
678 'name' => 'created_date',
679 'type' => 256,
680 'title' => 'Created Date',
681 'required' => '',
682 'export' => TRUE,
683 'where' => 'civicrm_contact.created_date',
684 'default' => 'NULL',
685 ),
686 'modified_date' => array(
687 'name' => 'modified_date',
688 'type' => 256,
689 'title' => 'Modified Date',
690 'required' => '',
691 'export' => TRUE,
692 'where' => 'civicrm_contact.modified_date',
693 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
694 ),
695 'source' => array(
696 'name' => 'source',
697 'type' => 2,
698 'title' => 'Source of Contact Data',
699 'maxlength' => 255,
700 'size' => 30,
701 'import' => TRUE,
702 'where' => 'civicrm_contact.source',
703 'headerPattern' => '/(S(ource\\s)?o(f\\s)?C(ontact\\s)?Data)$/i',
704 'export' => TRUE,
705 'html' => array(
706 'type' => 'Text',
707 ),
708 'uniqueName' => 'contact_source',
709 ),
710 'employer_id' => array(
711 'name' => 'employer_id',
712 'type' => 1,
713 'title' => 'Current Employer ID',
714 'export' => TRUE,
715 'where' => 'civicrm_contact.employer_id',
716 'FKClassName' => 'CRM_Contact_DAO_Contact',
717 'html' => array(
718 'type' => 'Autocomplete-Select',
719 ),
720 'uniqueName' => 'current_employer_id',
721 'FKApiName' => 'Contact',
722 ),
723 'is_deleted' => array(
724 'name' => 'is_deleted',
725 'type' => 16,
726 'title' => 'Contact is in Trash',
727 'required' => TRUE,
728 'export' => TRUE,
729 'where' => 'civicrm_contact.is_deleted',
730 'html' => array(
731 'type' => 'CheckBox',
732 ),
733 'uniqueName' => 'contact_is_deleted',
734 ),
735 'custom_1' => array(
736 'label' => 'Our special field',
737 'groupTitle' => 'select_test_g',
738 'data_type' => 'String',
739 'html_type' => 'Select',
740 'default_value' => '',
741 'text_length' => '',
742 'options_per_line' => '',
743 'custom_group_id' => '1',
744 'extends' => 'Contact',
745 'is_search_range' => 0,
746 'extends_entity_column_value' => '',
747 'extends_entity_column_id' => '',
748 'is_view' => 0,
749 'is_multiple' => 0,
750 'option_group_id' => '105',
751 'date_format' => '',
752 'time_format' => '',
753 'is_required' => '1',
754 'name' => 'custom_1',
755 'title' => 'Our special field',
756 'type' => 2,
757 'options' => array(
758 '1' => 'Label1',
759 '2' => 'Label2',
760 ),
761 ),
762 'current_employer' => array(
763 'title' => 'Current Employer',
764 'description' => 'Name of Current Employer',
765 'type' => 2,
766 ),
767 'dupe_check' => array(
768 'title' => 'Check for Duplicates',
769 'description' => 'Throw error if contact create matches dedupe rule',
770 ),
771 ),
772 );
773
774 return $expectedResult;
775 }
776
777 /**
778 * This example has been generated from the API test suite.
779 * The test that created it is called
780 * testCustomFieldCreateWithOptionValues
781 * and can be found in
782 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ContactTest.php
783 *
784 * You can see the outcome of the API tests at
785 * https://test.civicrm.org/job/CiviCRM-master-git/
786 *
787 * To Learn about the API read
788 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
789 *
790 * Browse the api on your own site with the api explorer
791 * http://MYSITE.ORG/path/to/civicrm/api/explorer
792 *
793 * Read more about testing here
794 * http://wiki.civicrm.org/confluence/display/CRM/Testing
795 *
796 * API Standards documentation:
797 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
798 */