Merge pull request #869 from totten/cms-perms
[civicrm-core.git] / tests / phpunit / api / v3 / ProfileTest.php
1 <?php
2
3 /*
4 +--------------------------------------------------------------------+
5 | CiviCRM version 4.3 |
6 +--------------------------------------------------------------------+
7 | Copyright CiviCRM LLC (c) 2004-2013 |
8 +--------------------------------------------------------------------+
9 | This file is a part of CiviCRM. |
10 | |
11 | CiviCRM is free software; you can copy, modify, and distribute it |
12 | under the terms of the GNU Affero General Public License |
13 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | |
15 | CiviCRM is distributed in the hope that it will be useful, but |
16 | WITHOUT ANY WARRANTY; without even the implied warranty of |
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
18 | See the GNU Affero General Public License for more details. |
19 | |
20 | You should have received a copy of the GNU Affero General Public |
21 | License and the CiviCRM Licensing Exception along |
22 | with this program; if not, contact CiviCRM LLC |
23 | at info[AT]civicrm[DOT]org. If you have questions about the |
24 | GNU Affero General Public License or the licensing of CiviCRM, |
25 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
26 +--------------------------------------------------------------------+
27 */
28
29 /**
30 * Include class definitions
31 */
32 require_once 'tests/phpunit/CiviTest/CiviUnitTestCase.php';
33
34 /**
35 * Test APIv3 civicrm_profile_* functions
36 *
37 * @package CiviCRM
38 */
39 class api_v3_ProfileTest extends CiviUnitTestCase {
40 protected $_apiversion;
41 function get_info() {
42 return array(
43 'name' => 'Profile Test',
44 'description' => 'Test all profile API methods.',
45 'group' => 'CiviCRM API Tests',
46 );
47 }
48
49 function setUp() {
50 $this->_apiversion = 3;
51 parent::setUp();
52 $config = CRM_Core_Config::singleton();
53 $config->countryLimit[1] = 1013;
54 $config->stateLimit[1] = 1013;
55 }
56
57 function tearDown() {
58 $this->quickCleanup(array(
59 'civicrm_uf_field',
60 'civicrm_uf_join',
61 'civicrm_uf_group',
62 'civicrm_custom_field',
63 'civicrm_custom_group',
64 'civicrm_contact',
65 'civicrm_phone',
66 'civicrm_address',
67 ));
68 }
69
70 ////////////// test civicrm_api3_profile_get //////////////////
71
72 /**
73 * check Without ProfileId
74 */
75 function testProfileGetWithoutProfileId() {
76 $params = array(
77 'contact_id' => 1,
78 'version' => 3,
79 );
80 $result = civicrm_api('profile', 'get', $params);
81 $this->assertEquals($result['is_error'], 1);
82 $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: profile_id');
83 }
84
85 /**
86 * check with no invalid profile Id
87 */
88 function testProfileGetInvalidProfileId() {
89 $params = array(
90 'contact_id' => 1,
91 'profile_id' => 1000,
92 'version' => 3,
93 );
94 $result = civicrm_api('profile', 'get', $params);
95 $this->assertEquals($result['is_error'], 1);
96 }
97
98 /**
99 * check with success
100 */
101 function testProfileGet() {
102 $pofileFieldValues = $this->_createIndividualContact();
103 $expected = current($pofileFieldValues);
104 $contactId = key($pofileFieldValues);
105 $params = array(
106 'profile_id' => 25,
107 'contact_id' => $contactId,
108 'version' => 3,
109 );
110
111 $result = civicrm_api('profile', 'get', $params);
112 $this->documentMe($params, $result, __FUNCTION__, __FILE__);
113
114 $this->assertEquals(0, $result['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $result)
115 );
116
117 foreach ($expected as $profileField => $value) {
118 $this->assertEquals($value, CRM_Utils_Array::value($profileField, $result['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$profileField}"
119 );
120 }
121
122 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_contact'));
123 }
124
125 /*
126 * check contact activity profile without activity id
127 */
128 function testContactActivityGetWithoutActivityId() {
129 list($params, $expected) = $this->_createContactWithActivity();
130
131 unset($params['activity_id']);
132 $result = civicrm_api('profile', 'get', $params);
133
134 $this->assertEquals($result['is_error'], 1);
135 $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: activity_id');
136 }
137
138 /*
139 * check contact activity profile wrong activity id
140 */
141 function testContactActivityGetWrongActivityId() {
142 list($params, $expected) = $this->_createContactWithActivity();
143
144 $params['activity_id'] = 100001;
145 $result = civicrm_api('profile', 'get', $params);
146
147 $this->assertEquals($result['is_error'], 1);
148 $this->assertEquals($result['error_message'], 'Invalid Activity Id (aid).');
149
150 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
151 }
152
153 /*
154 * check contact activity profile with wrong activity type
155 */
156 function testContactActivityGetWrongActivityType() {
157 //flush cache by calling with reset
158 $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name', TRUE);
159
160 $sourceContactId = $this->householdCreate();
161
162 $activityparams = array(
163 'source_contact_id' => $sourceContactId,
164 'activity_type_id' => '2',
165 'subject' => 'Test activity',
166 'activity_date_time' => '20110316',
167 'duration' => '120',
168 'location' => 'Pensulvania',
169 'details' => 'a test activity',
170 'status_id' => '1',
171 'version' => '3',
172 'priority_id' => '1',
173 );
174
175 $activity = civicrm_api('activity', 'create', $activityparams);
176 $this->assertEquals(0, $activity['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $activity)
177 );
178
179 $activityValues = array_pop($activity['values']);
180
181 list($params, $expected) = $this->_createContactWithActivity();
182
183 $params['activity_id'] = $activityValues['id'];
184 $result = civicrm_api('profile', 'get', $params);
185
186 $this->assertEquals($result['is_error'], 1);
187 $this->assertEquals($result['error_message'], 'This activity cannot be edited or viewed via this profile.');
188
189 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
190 }
191
192 /*
193 * check contact activity profile with success
194 */
195 function testContactActivityGetSuccess() {
196 list($params, $expected) = $this->_createContactWithActivity();
197
198 $result = civicrm_api('profile', 'get', $params);
199
200 $this->assertEquals(0, $result['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $result)
201 );
202
203 foreach ($expected as $profileField => $value) {
204 $this->assertEquals($value, CRM_Utils_Array::value($profileField, $result['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$profileField}"
205 );
206 }
207
208 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
209 }
210
211 /////////////// test civicrm_api3_profile_set //////////////////
212
213 /**
214 * check with no array
215 */
216 function testProfileSetNoArray() {
217 $params = NULL;
218 $result = civicrm_api('profile', 'set', $params);
219 $this->assertEquals($result['is_error'], 1);
220 $this->assertEquals($result['error_message'], 'Input variable `params` is not an array');
221 }
222
223 /**
224 * check Without ProfileId
225 */
226 function testProfileSetWithoutProfileId() {
227 $params = array(
228 'contact_id' => 1,
229 'version' => 3,
230 );
231 $result = civicrm_api('profile', 'set', $params);
232 $this->assertEquals($result['is_error'], 1);
233 $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: profile_id');
234 }
235
236 /**
237 * check with no invalid profile Id
238 */
239 function testProfileSetInvalidProfileId() {
240 $params = array(
241 'contact_id' => 1,
242 'profile_id' => 1000,
243 'version' => 3,
244 );
245 $result = civicrm_api('profile', 'set', $params);
246 $this->assertEquals($result['is_error'], 1);
247 }
248
249 /**
250 * check with missing required field in profile
251 */
252 function testProfileSetCheckProfileRequired() {
253 $pofileFieldValues = $this->_createIndividualContact();
254 current($pofileFieldValues);
255 $contactId = key($pofileFieldValues);
256 $updateParams = array(
257 'first_name' => 'abc2',
258 'last_name' => 'xyz2',
259 'phone-1-1' => '022 321 826',
260 'country-1' => '1013',
261 'state_province-1' => '1000',
262 );
263
264 $params = array_merge(array('profile_id' => 25, 'contact_id' => $contactId, 'version' => 3),
265 $updateParams
266 );
267
268 $result = civicrm_api('profile', 'set', $params);
269
270 $this->assertEquals($result['is_error'], 1);
271 $this->assertEquals($result['error_message'], 'Missing required parameters for profile id 25: email-Primary');
272
273 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_contact'));
274 }
275
276 /**
277 * check with success
278 */
279 function testProfileSet() {
280 $pofileFieldValues = $this->_createIndividualContact();
281 current($pofileFieldValues);
282 $contactId = key($pofileFieldValues);
283
284 $updateParams = array(
285 'first_name' => 'abc2',
286 'last_name' => 'xyz2',
287 'email-Primary' => 'abc2.xyz2@gmail.com',
288 'phone-1-1' => '022 321 826',
289 'country-1' => '1013',
290 'state_province-1' => '1000',
291 );
292
293 $params = array_merge(array(
294 'profile_id' => 25,
295 'contact_id' => $contactId,
296 'version' => 3,
297 ), $updateParams);
298
299 $result = civicrm_api('profile', 'set', $params);
300 $this->documentMe($params, $result, __FUNCTION__, __FILE__);
301
302 $this->assertEquals(0, $result['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $result)
303 );
304
305 $getParams = array(
306 'profile_id' => 25,
307 'contact_id' => $contactId,
308 'version' => 3,
309 );
310 $profileDetails = civicrm_api('profile', 'get', $getParams);
311 $this->assertEquals(0, $profileDetails['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $profileDetails)
312 );
313
314 foreach ($updateParams as $profileField => $value) {
315 $this->assertEquals($value, CRM_Utils_Array::value($profileField, $profileDetails['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$profileField}"
316 );
317 }
318 }
319
320 /*
321 * check contact activity profile without activity id
322 */
323 function testContactActivitySetWithoutActivityId() {
324 list($params, $expected) = $this->_createContactWithActivity();
325
326 $params = array_merge($params, $expected);
327 unset($params['activity_id']);
328 $result = civicrm_api('profile', 'set', $params);
329
330 $this->assertEquals($result['is_error'], 1);
331 $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: activity_id');
332
333 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
334 }
335
336 /*
337 * check contact activity profile wrong activity id
338 */
339 function testContactActivitySetWrongActivityId() {
340 list($params, $expected) = $this->_createContactWithActivity();
341
342 $params = array_merge($params, $expected);
343 $params['activity_id'] = 100001;
344 $result = civicrm_api('profile', 'set', $params);
345
346 $this->assertEquals($result['is_error'], 1);
347 $this->assertEquals($result['error_message'], 'Invalid Activity Id (aid).');
348
349 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
350 }
351
352 /*
353 * check contact activity profile with wrong activity type
354 */
355 function testContactActivitySetWrongActivityType() {
356 //flush cache by calling with reset
357 $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name', TRUE);
358
359 $sourceContactId = $this->householdCreate();
360
361 $activityparams = array(
362 'source_contact_id' => $sourceContactId,
363 'activity_type_id' => '2',
364 'subject' => 'Test activity',
365 'activity_date_time' => '20110316',
366 'duration' => '120',
367 'location' => 'Pensulvania',
368 'details' => 'a test activity',
369 'status_id' => '1',
370 'version' => '3',
371 'priority_id' => '1',
372 );
373
374 $activity = civicrm_api('activity', 'create', $activityparams);
375 $this->assertEquals(0, $activity['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $activity)
376 );
377
378 $activityValues = array_pop($activity['values']);
379
380 list($params, $expected) = $this->_createContactWithActivity();
381
382 $params = array_merge($params, $expected);
383 $params['activity_id'] = $activityValues['id'];
384 $result = civicrm_api('profile', 'set', $params);
385
386 $this->assertEquals($result['is_error'], 1);
387 $this->assertEquals($result['error_message'], 'This activity cannot be edited or viewed via this profile.');
388
389 $this->quickCleanup(array('civicrm_uf_field', 'civicrm_uf_join', 'civicrm_uf_group', 'civicrm_custom_field', 'civicrm_custom_group', 'civicrm_contact'));
390 }
391
392 /*
393 * check contact activity profile with success
394 */
395 function testContactActivitySetSuccess() {
396 list($params, $expected) = $this->_createContactWithActivity();
397
398 $updateParams = array(
399 'first_name' => 'abc2',
400 'last_name' => 'xyz2',
401 'email-Primary' => 'abc2.xyz2@yahoo.com',
402 'activity_subject' => 'Test Meeting',
403 'activity_details' => 'a test activity details',
404 'activity_duration' => '100',
405 'activity_date_time' => '03/08/2010',
406 'activity_status_id' => '2',
407 );
408 $profileParams = array_merge($params, $updateParams);
409 $profile = civicrm_api('profile', 'set', $profileParams);
410 $result = civicrm_api('profile', 'get', $params);
411 $this->assertEquals(0, $result['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $result)
412 );
413
414 foreach ($updateParams as $profileField => $value) {
415 $this->assertEquals($value, CRM_Utils_Array::value($profileField, $result['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$profileField}"
416 );
417 }
418
419 $this->quickCleanup(array(
420 'civicrm_uf_field',
421 'civicrm_uf_join',
422 'civicrm_uf_group',
423 'civicrm_custom_field',
424 'civicrm_custom_group',
425 'civicrm_contact',
426 ),
427 TRUE
428 );
429 }
430
431 /////////////// test civicrm_api3_profile_apply //////////////////
432
433 /**
434 * check Without ProfileId
435 */
436 function testProfileApplyWithoutProfileId() {
437 $params = array(
438 'contact_id' => 1,
439 'version' => 3,
440 );
441 $result = civicrm_api('profile', 'apply', $params);
442 $this->assertEquals($result['is_error'], 1);
443 $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: profile_id');
444 }
445
446 /**
447 * check with no invalid profile Id
448 */
449 function testProfileApplyInvalidProfileId() {
450 $params = array(
451 'contact_id' => 1,
452 'profile_id' => 1000,
453 'version' => 3,
454 );
455 $result = civicrm_api('profile', 'apply', $params);
456 $this->assertEquals($result['is_error'], 1);
457 }
458
459 /**
460 * check with success
461 */
462 function testProfileApply() {
463 $pofileFieldValues = $this->_createIndividualContact();
464 current($pofileFieldValues);
465 $contactId = key($pofileFieldValues);
466
467 $params = array(
468 'profile_id' => 25,
469 'contact_id' => $contactId,
470 'version' => 3,
471 'first_name' => 'abc2',
472 'last_name' => 'xyz2',
473 'email-Primary' => 'abc2.xyz2@gmail.com',
474 'phone-1-1' => '022 321 826',
475 'country-1' => '1013',
476 'state_province-1' => '1000',
477 );
478
479 $result = civicrm_api('profile', 'apply', $params);
480 $this->documentMe($params, $result, __FUNCTION__, __FILE__);
481
482 $this->assertEquals(0, $result['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $result)
483 );
484
485 // Expected field values
486 $expected['contact'] = array(
487 'contact_id' => $contactId,
488 'contact_type' => 'Individual',
489 'first_name' => 'abc2',
490 'last_name' => 'xyz2',
491 );
492 $expected['email'] = array(
493 'location_type_id' => 1,
494 'is_primary' => 1,
495 'email' => 'abc2.xyz2@gmail.com',
496 );
497
498 $expected['phone'] = array(
499 'location_type_id' => 1,
500 'is_primary' => 1,
501 'phone_type_id' => 1,
502 'phone' => '022 321 826',
503 );
504 $expected['address'] = array(
505 'location_type_id' => 1,
506 'is_primary' => 1,
507 'country_id' => 1013,
508 'state_province_id' => 1000,
509 );
510
511 foreach ($expected['contact'] as $field => $value) {
512 $this->assertEquals($value, CRM_Utils_Array::value($field, $result['values']), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$field}"
513 );
514 }
515
516 foreach (array(
517 'email', 'phone', 'address') as $fieldType) {
518 $typeValues = array_pop($result['values'][$fieldType]);
519 foreach ($expected[$fieldType] as $field => $value) {
520 $this->assertEquals($value, CRM_Utils_Array::value($field, $typeValues), "In line " . __LINE__ . " error message: " . "missing/mismatching value for {$field} ({$fieldType})"
521 );
522 }
523 }
524 }
525
526 /*
527 * Helper function to create an Individual with address/email/phone info. Import UF Group and UF Fields
528 */
529 function _createIndividualContact() {
530 $contactParams = array(
531 'first_name' => 'abc1',
532 'last_name' => 'xyz1',
533 'contact_type' => 'Individual',
534 'email' => 'abc1.xyz1@yahoo.com',
535 'version' => '3',
536 'api.address.create' => array(
537 'location_type_id' => 1,
538 'is_primary' => 1,
539 'name' => 'Saint Helier St',
540 'county' => 'Marin',
541 'country' => 'United States',
542 'state_province' => 'Michigan',
543 'supplemental_address_1' => 'Hallmark Ct',
544 'supplemental_address_2' => 'Jersey Village',
545 ),
546 'api.phone.create' => array(
547 'location_type_id' => '1',
548 'phone' => '021 512 755',
549 'phone_type_id' => '1',
550 'is_primary' => '1',
551 ),
552 );
553
554 $contact = civicrm_api('contact', 'create', $contactParams);
555
556 $this->assertEquals(0, $contact['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $contact)
557 );
558
559 $keys = array_keys($contact['values']);
560 $contactId = array_pop($keys);
561
562 $this->assertEquals(0, $contact['values'][$contactId]['api.address.create']['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $contact['values'][$contactId]['api.address.create'])
563 );
564 $this->assertEquals(0, $contact['values'][$contactId]['api.phone.create']['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $contact['values'][$contactId]['api.phone.create'])
565 );
566
567 // Create new profile having group_type: Contact,Individual
568 $op = new PHPUnit_Extensions_Database_Operation_Insert();
569 $op->execute($this->_dbconn,
570 new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
571 dirname(__FILE__) . "/dataset/uf_group_25.xml"
572 )
573 );
574 // Create Contact + Idividual fields for profile
575 $op = new PHPUnit_Extensions_Database_Operation_Insert();
576 $op->execute($this->_dbconn,
577 new PHPUnit_Extensions_Database_DataSet_XMLDataSet(
578 dirname(__FILE__) . "/dataset/uf_field_uf_group_25.xml"
579 )
580 );
581
582
583 // expected result of above created profile with contact Id $contactId
584 $profileData[$contactId] = array(
585 'first_name' => 'abc1',
586 'last_name' => 'xyz1',
587 'email-Primary' => 'abc1.xyz1@yahoo.com',
588 'phone-1-1' => '021 512 755',
589 'country-1' => '1228',
590 'state_province-1' => '1021',
591 );
592
593 return $profileData;
594 }
595
596 function _createContactWithActivity() {
597 // @TODO: Create profile with custom fields
598 $op = new PHPUnit_Extensions_Database_Operation_Insert();
599 $op->execute($this->_dbconn,
600 new PHPUnit_Extensions_Database_DataSet_FlatXMLDataSet(
601 dirname(__FILE__) . '/dataset/uf_group_contact_activity_26.xml'
602 )
603 );
604 // hack: xml data set do not accept \ 1 (CRM_Core_DAO::VALUE_SEPARATOR)
605 CRM_Core_DAO::setFieldValue('CRM_Core_DAO_UFGroup', '26', 'group_type', 'Individual,Contact,Activity' . CRM_Core_DAO::VALUE_SEPARATOR . 'ActivityType:1');
606
607 $sourceContactId = $this->individualCreate();
608 $contactParams = array(
609 'first_name' => 'abc1',
610 'last_name' => 'xyz1',
611 'contact_type' => 'Individual',
612 'email' => 'abc1.xyz1@yahoo.com',
613 'version' => '3',
614 'api.address.create' => array(
615 'location_type_id' => 1,
616 'is_primary' => 1,
617 'name' => 'Saint Helier St',
618 'county' => 'Marin',
619 'country' => 'United States',
620 'state_province' => 'Michigan',
621 'supplemental_address_1' => 'Hallmark Ct',
622 'supplemental_address_2' => 'Jersey Village',
623 ),
624 );
625
626 $contact = civicrm_api('contact', 'create', $contactParams);
627
628 $this->assertEquals(0, $contact['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $contact)
629 );
630
631 $keys = array_keys($contact['values']);
632 $contactId = array_pop($keys);
633
634 $this->assertEquals(0, $contact['values'][$contactId]['api.address.create']['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $contact['values'][$contactId]['api.address.create'])
635 );
636
637 $activityParams = array(
638 'source_contact_id' => $sourceContactId,
639 'assignee_contact_id' => $contactId,
640 'activity_type_id' => '1',
641 'subject' => 'Make-it-Happen Meeting',
642 'activity_date_time' => '20110316',
643 'duration' => '120',
644 'location' => 'Pensulvania',
645 'details' => 'a test activity',
646 'status_id' => '1',
647 'version' => '3',
648 'priority_id' => '1',
649 );
650 $activity = civicrm_api('activity', 'create', $activityParams);
651 $this->assertEquals(0, $activity['is_error'], "In line " . __LINE__ . " error message: " . CRM_Utils_Array::value('error_message', $activity)
652 );
653
654 $activityValues = array_pop($activity['values']);
655
656 // valid parameters for above profile
657 $profileParams = array(
658 'profile_id' => 26,
659 'contact_id' => $contactId,
660 'activity_id' => $activityValues['id'],
661 'version' => 3,
662 );
663
664 // expected result of above created profile
665 $expected = array(
666 'first_name' => 'abc1',
667 'last_name' => 'xyz1',
668 'email-Primary' => 'abc1.xyz1@yahoo.com',
669 'activity_subject' => 'Make-it-Happen Meeting',
670 'activity_details' => 'a test activity',
671 'activity_duration' => '120',
672 'activity_date_time_time' => '12:00AM',
673 'activity_date_time' => '03/16/2011',
674 'activity_status_id' => '1',
675 );
676
677 return array($profileParams, $expected);
678 }
679 }
680