<?php
/**
- * Test Generated example of using activity create API
+ * Test Generated example of using activity Create API
* demonstrates create with Contact Reference Custom Field *
*/
function activity_create_example(){
$params = array(
- 'source_contact_id' => 17,
+ 'source_contact_id' => 1,
'activity_type_id' => '46',
'subject' => 'test activity type id',
'activity_date_time' => '2011-06-02 14:36:13',
'duration' => 120,
'location' => 'Pensulvania',
'details' => 'a test activity',
- 'custom_2' => '17',
+ 'custom_2' => '1',
);
try{
- $result = civicrm_api3('activity', 'create', $params);
+ $result = civicrm_api3('activity', 'Create', $params);
}
catch (CiviCRM_API3_Exception $e) {
// handle error here
<?php
/**
- * Test Generated example of using activity create API
+ * Test Generated example of using activity get API
* Get with Contact Ref Custom Field *
*/
-function activity_create_example(){
+function activity_get_example(){
$params = array(
- 'source_contact_id' => 17,
- 'activity_type_id' => '46',
- 'subject' => 'test activity type id',
- 'activity_date_time' => '2011-06-02 14:36:13',
- 'status_id' => 2,
- 'priority_id' => 1,
- 'duration' => 120,
- 'location' => 'Pensulvania',
- 'details' => 'a test activity',
- 'custom_2' => '17',
+ 'return.custom_2' => 1,
+ 'id' => 1,
);
try{
- $result = civicrm_api3('activity', 'create', $params);
+ $result = civicrm_api3('activity', 'get', $params);
}
catch (CiviCRM_API3_Exception $e) {
// handle error here
/**
* Function returns array of result expected from previous function
*/
-function activity_create_expectedresult(){
+function activity_get_expectedresult(){
$expectedResult = array(
'is_error' => 0,
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
- 'source_contact_id' => '17',
- 'custom_2_id' => '17',
- 'custom_2_1_id' => '17',
- 'custom_2' => 'Contact, Test',
- 'custom_2_1' => 'Contact, Test',
+ 'source_contact_id' => '1',
+ 'custom_2_id' => '1',
+ 'custom_2_1_id' => '1',
+ 'custom_2' => 'Anderson, Anthony',
+ 'custom_2_1' => 'Anderson, Anthony',
),
),
);
*/
function activity_get_example(){
$params = array(
- 'source_contact_id' => 17,
+ 'source_contact_id' => 1,
'filter.activity_date_time_high' => '20120101000000',
'sequential' => 1,
);
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
- 'source_contact_id' => '17',
+ 'source_contact_id' => '1',
),
),
);
'is_auto' => 0,
'is_current_revision' => '1',
'is_deleted' => 0,
- 'source_contact_id' => '17',
+ 'source_contact_id' => '1',
),
),
);
*/
function activity__example(){
$params = array(
- 'source_contact_id' => 17,
+ 'source_contact_id' => 1,
'subject' => 'Make-it-Happen Meeting',
'activity_date_time' => '20110316',
'duration' => 120,
'status_id' => 1,
'activity_type_id' => 1,
'priority_id' => 1,
- 'target_contact_id' => 17,
- 'assignee_contact_id' => 17,
+ 'target_contact_id' => 1,
+ 'assignee_contact_id' => 1,
);
try{
'is_current_revision' => '1',
'is_deleted' => 0,
'assignee_contact_id' => array(
- '0' => '19',
+ '0' => '3',
),
- 'source_contact_id' => '17',
+ 'source_contact_id' => '1',
'api.contact.get' => array(
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 17,
+ 'id' => 1,
'values' => array(
'0' => array(
- 'contact_id' => '17',
+ 'contact_id' => '1',
'contact_type' => 'Individual',
'contact_sub_type' => '',
- 'sort_name' => '',
- 'display_name' => 'Test Contact',
- 'do_not_email' => '',
- 'do_not_phone' => '',
- 'do_not_mail' => '',
- 'do_not_sms' => '',
- 'do_not_trade' => '',
+ 'sort_name' => 'Anderson, Anthony',
+ 'display_name' => 'Mr. Anthony Anderson II',
+ 'do_not_email' => 0,
+ 'do_not_phone' => 0,
+ 'do_not_mail' => 0,
+ 'do_not_sms' => 0,
+ 'do_not_trade' => 0,
'is_opt_out' => 0,
'legal_identifier' => '',
'external_identifier' => '',
'nick_name' => '',
'legal_name' => '',
'image_URL' => '',
- 'preferred_mail_format' => '',
- 'first_name' => 'Test',
- 'middle_name' => '',
- 'last_name' => 'Contact',
+ 'preferred_mail_format' => 'Both',
+ 'first_name' => 'Anthony',
+ 'middle_name' => 'J.',
+ 'last_name' => 'Anderson',
'job_title' => '',
'birth_date' => '',
'is_deceased' => 0,
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
- 'email_id' => '',
- 'email' => '',
- 'on_hold' => '',
+ 'email_id' => '1',
+ 'email' => 'anthony_anderson@civicrm.org',
+ 'on_hold' => 0,
'im_id' => '',
'provider_id' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
- 'id' => '17',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
+ 'id' => '1',
),
),
),
*/
function activity_create_example(){
$params = array(
- 'source_contact_id' => 17,
+ 'source_contact_id' => 1,
'activity_type_id' => '46',
'subject' => 'test activity type id',
'activity_date_time' => '2011-06-02 14:36:13',
*/
function activity_get_example(){
$params = array(
- 'contact_id' => 17,
+ 'contact_id' => 1,
'activity_type_id' => '46',
'sequential' => 1,
'return.custom_1' => 1,
'id' => 1,
'values' => array(
'0' => array(
- 'source_contact_id' => '17',
+ 'source_contact_id' => '1',
'id' => '1',
'activity_type_id' => '46',
'subject' => 'test activity type id',
'title' => 'New Batch 03',
'description' => 'This is description for New Batch 03',
'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
+ 'created_date' => '',
'modified_id' => '',
- 'modified_date' => '2012-11-14 16:02:35',
+ 'modified_date' => '',
'saved_search_id' => '',
'status_id' => '1',
'type_id' => '',
'title' => 'New Batch 04',
'description' => 'This is description for New Batch 04',
'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
+ 'created_date' => '',
'modified_id' => '',
- 'modified_date' => '2012-11-14 16:02:35',
+ 'modified_date' => '',
'saved_search_id' => '',
'status_id' => '',
'type_id' => '',
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '1',
'api.website.get' => array(
'is_error' => 0,
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '1',
'api.website.getValue' => 'http://civicrm.org',
'api.Contribution.getCount' => 2,
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '1',
'api.website.getValue' => 'http://civicrm.org',
'api.Contribution.getCount' => 2,
'first_name' => '',
'middle_name' => '',
'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => '',
'first_name' => 'abc3',
'middle_name' => '',
'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => '',
'contribution_status_id' => '1',
'honor_type_id' => '',
'address_id' => '',
- 'check_number' => 'null',
+ 'check_number' => '',
'campaign_id' => '',
'contribution_type_id' => '1',
),
'first_name' => 'abc3',
'middle_name' => '',
'last_name' => 'xyz3',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => '',
'contribution_status_id' => '1',
'honor_type_id' => '',
'address_id' => '',
- 'check_number' => 'null',
+ 'check_number' => '',
'campaign_id' => '',
'contribution_type_id' => '1',
),
'dataPattern' => '/^\w+(\s\w+)?+$/',
'export' => true,
),
+ 'prefix_id' => array(
+ 'name' => 'prefix_id',
+ 'type' => 1,
+ 'title' => 'Individual Prefix',
+ 'import' => true,
+ 'where' => 'civicrm_contact.prefix_id',
+ 'headerPattern' => '/^(prefix|title)/i',
+ 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\.?$/i',
+ 'export' => true,
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'individual_prefix',
+ ),
+ ),
+ 'suffix_id' => array(
+ 'name' => 'suffix_id',
+ 'type' => 1,
+ 'title' => 'Individual Suffix',
+ 'import' => true,
+ 'where' => 'civicrm_contact.suffix_id',
+ 'headerPattern' => '/^suffix$/i',
+ 'dataPattern' => '/^(sr|jr)\.?|i{2,}$/',
+ 'export' => true,
+ 'pseudoconstant' => array(
+ 'optionGroupName' => 'individual_suffix',
+ ),
+ ),
'email_greeting_id' => array(
'name' => 'email_greeting_id',
'type' => 1,
'export' => true,
'uniqueName' => 'contact_source',
),
- 'prefix_id' => array(
- 'name' => 'prefix_id',
- 'type' => 1,
- 'title' => 'Individual Prefix',
- 'import' => true,
- 'where' => 'civicrm_contact.prefix_id',
- 'headerPattern' => '/^(prefix|title)/i',
- 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\.?$/i',
- 'export' => true,
- 'pseudoconstant' => array(
- 'optionGroupName' => 'individual_prefix',
- ),
- 'uniqueName' => 'individual_prefix_id',
- ),
- 'suffix_id' => array(
- 'name' => 'suffix_id',
- 'type' => 1,
- 'title' => 'Individual Suffix',
- 'import' => true,
- 'where' => 'civicrm_contact.suffix_id',
- 'headerPattern' => '/^suffix$/i',
- 'dataPattern' => '/^(sr|jr)\.?|i{2,}$/',
- 'export' => true,
- 'pseudoconstant' => array(
- 'optionGroupName' => 'individual_suffix',
- ),
- 'uniqueName' => 'individual_suffix_id',
- ),
'employer_id' => array(
'name' => 'employer_id',
'type' => 1,
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '17',
);
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '1',
),
),
'first_name' => 'abc1',
'middle_name' => '',
'last_name' => 'xyz1',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => '',
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '1',
),
),
'contribution_status_id' => '1',
'honor_type_id' => '',
'address_id' => '',
- 'check_number' => 'null',
+ 'check_number' => '',
'campaign_id' => '',
'contribution_type_id' => '1',
),
'contribution_status_id' => '1',
'honor_type_id' => '',
'address_id' => '',
- 'check_number' => 'null',
+ 'check_number' => '',
'campaign_id' => '',
'contribution_type_id' => '1',
'api.line_item.create' => array(
'start_date' => '',
'end_date' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
+ 'created_date' => '',
'currency' => 'NZD',
'campaign_id' => '',
'is_share' => '',
'frequency_unit' => 'day',
'frequency_interval' => '1',
'installments' => '12',
- 'start_date' => '20120101000000',
+ 'start_date' => '2013-07-29 00:00:00',
'create_date' => '20120130621222105',
- 'modified_date' => '2012-11-14 16:02:35',
+ 'modified_date' => '',
'cancel_date' => '',
'end_date' => '',
'processor_id' => '',
'frequency_unit' => 'day',
'frequency_interval' => '1',
'installments' => '12',
- 'start_date' => '2012-01-01 00:00:00',
+ 'start_date' => '2013-07-29 00:00:00',
'create_date' => '20120130621222105',
'contribution_status_id' => '1',
'is_test' => 0,
'name' => 'test_group_1',
'title' => 'Test_Group_1',
'extends' => 'Individual',
- 'extends_entity_column_id' => 'null',
- 'extends_entity_column_value' => 'null',
+ 'extends_entity_column_id' => '',
+ 'extends_entity_column_value' => '',
'style' => 'Inline',
'collapse_display' => '1',
'help_pre' => 'This is Pre Help For Test Group 1',
'table_name' => 'civicrm_value_test_group_1_1',
'is_multiple' => '',
'min_multiple' => '',
- 'max_multiple' => 'null',
+ 'max_multiple' => '',
'collapse_adv_display' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 08:49:19',
+ 'created_date' => '',
'is_reserved' => '',
),
),
'geo_code_1' => '',
'geo_code_2' => '',
'state_province_id' => '',
- 'state_province_name' => '',
- 'state_province' => '',
'country_id' => '',
- 'country' => '',
'phone_id' => '',
'phone_type_id' => '',
'phone' => '',
'im' => '',
'worldregion_id' => '',
'world_region' => '',
+ 'state_province_name' => '',
+ 'state_province' => '',
+ 'country' => '',
'id' => '10',
'api.email.replace' => array(
'is_error' => 0,
'is_multiple_registrations' => 0,
'allow_same_participant_emails' => 0,
'is_template' => 0,
- 'created_date' => '2013-07-28 19:57:44',
+ 'created_date' => '2013-08-03 21:23:22',
'is_share' => '1',
'available_places' => 0,
'is_full' => '1',
'event_type_id' => '1',
'participant_listing_id' => '',
'is_public' => '1',
- 'start_date' => '20081021000000',
- 'end_date' => '20081023000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
'is_online_registration' => '1',
'registration_link_text' => '',
'registration_start_date' => '20080601000000',
'event_type_id' => '1',
'participant_listing_id' => 0,
'is_public' => '1',
- 'start_date' => '2008-10-21 00:00:00',
- 'event_start_date' => '2008-10-21 00:00:00',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
'is_online_registration' => 0,
'is_monetary' => 0,
'is_map' => 0,
'id' => '1',
'contact_id' => '3',
'application_received_date' => '20130728084957',
- 'decision_date' => '20130729000000',
+ 'decision_date' => '20130805000000',
'money_transfer_date' => '',
'grant_due_date' => '',
'grant_report_received' => '',
'id' => '2',
'contact_id' => '4',
'application_received_date' => '20130728084957',
- 'decision_date' => '2013-07-29',
+ 'decision_date' => '2013-08-05',
'grant_type_id' => '1',
'amount_total' => '500.00',
'currency' => 'USD',
'is_active' => '1',
'visibility' => 'Public Pages',
'where_clause' => ' ( `civicrm_group_contact-1`.group_id IN ( 1 ) AND `civicrm_group_contact-1`.status IN ("Added") ) ',
- 'select_tables' => 'a:9:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:22:"civicrm_state_province";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
+ 'select_tables' => 'a:8:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
'where_tables' => 'a:2:{s:15:"civicrm_contact";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
'group_type' => array(
'0' => '1',
'is_active' => '1',
'visibility' => 'Public Pages',
'where_clause' => ' ( `civicrm_group_contact-1`.group_id IN ( 1 ) AND `civicrm_group_contact-1`.status IN ("Added") ) ',
- 'select_tables' => 'a:9:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:22:"civicrm_state_province";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
+ 'select_tables' => 'a:8:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
'where_tables' => 'a:2:{s:15:"civicrm_contact";i:1;s:25:"`civicrm_group_contact-1`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-1` ON contact_a.id = `civicrm_group_contact-1`.contact_id ";}',
'group_type' => array(
'0' => '1',
'is_active' => '1',
'visibility' => 'Public Pages',
'where_clause' => ' ( `civicrm_group_contact-4`.group_id IN ( 4 ) AND `civicrm_group_contact-4`.status IN ("Added") ) ',
- 'select_tables' => 'a:9:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:22:"civicrm_state_province";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-4`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON contact_a.id = `civicrm_group_contact-4`.contact_id ";}',
+ 'select_tables' => 'a:8:{s:15:"civicrm_contact";i:1;s:15:"civicrm_address";i:1;s:15:"civicrm_country";i:1;s:13:"civicrm_email";i:1;s:13:"civicrm_phone";i:1;s:10:"civicrm_im";i:1;s:19:"civicrm_worldregion";i:1;s:25:"`civicrm_group_contact-4`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON contact_a.id = `civicrm_group_contact-4`.contact_id ";}',
'where_tables' => 'a:2:{s:15:"civicrm_contact";i:1;s:25:"`civicrm_group_contact-4`";s:114:" LEFT JOIN civicrm_group_contact `civicrm_group_contact-4` ON contact_a.id = `civicrm_group_contact-4`.contact_id ";}',
'group_type' => array(
'0' => '1',
),
'email' => array(
'id' => '4',
- 'contact_id' => 'null',
+ 'contact_id' => '',
'location_type_id' => '1',
'email' => 'test2@loc.block',
'is_primary' => 0,
),
'phone' => array(
'id' => '3',
- 'contact_id' => 'null',
+ 'contact_id' => '',
'location_type_id' => '1',
'is_primary' => 0,
'is_billing' => '',
),
'phone_2' => array(
'id' => '4',
- 'contact_id' => 'null',
+ 'contact_id' => '',
'location_type_id' => '1',
'is_primary' => 0,
'is_billing' => '',
'1' => array(
'id' => '1',
'domain_id' => '1',
- 'header_id' => 'null',
- 'footer_id' => 'null',
+ 'header_id' => '',
+ 'footer_id' => '',
'reply_id' => '',
'unsubscribe_id' => '',
'resubscribe_id' => '',
$expectedResult = array(
'is_error' => 0,
'version' => 3,
- 'count' => 4,
+ 'count' => 1,
+ 'id' => 1,
'values' => array(
- 'contact_id' => '3',
- 'subscribe_id' => '1',
- 'hash' => 'bf4d724dbbb38c0c',
- 'is_error' => 0,
+ '1' => array(
+ 'contact_id' => '3',
+ 'subscribe_id' => '1',
+ 'hash' => '67eac7789eaee00',
+ ),
),
);
'membership_contact_id' => '13',
'membership_type_id' => '11',
'join_date' => '2009-01-21',
- 'start_date' => '2009-01-21',
+ 'start_date' => '2013-07-29 00:00:00',
'membership_start_date' => '2009-01-21',
- 'end_date' => '2009-12-21',
+ 'end_date' => '2013-08-04 00:00:00',
'membership_end_date' => '2009-12-21',
'source' => 'Payment',
'membership_source' => 'Payment',
'contact_id' => '25',
'membership_type_id' => '22',
'join_date' => '20090121000000',
- 'start_date' => '20090121000000',
- 'end_date' => '20091221000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
'source' => 'Payment',
'status_id' => '28',
'is_override' => '1',
'contact_id' => '10',
'membership_type_id' => '8',
'join_date' => '2009-01-21',
- 'start_date' => '2009-01-21',
- 'end_date' => '2009-12-21',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
'source' => 'Payment',
'status_id' => '15',
'is_override' => '1',
'contact_id' => '31',
'membership_type_id' => '28',
'join_date' => '20090121000000',
- 'start_date' => '20090121000000',
- 'end_date' => '20091221000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
'source' => 'Payment',
'status_id' => '34',
'is_override' => '1',
'first_name' => '',
'middle_name' => '',
'last_name' => '',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => '',
'display_name' => 'Mr. Anthony Anderson II',
'event_id' => '38',
'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2008-10-21 00:00:00',
- 'event_end_date' => '2008-10-23 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
'participant_id' => '2',
'participant_fee_level' => '',
'participant_fee_amount' => '',
'display_name' => 'Mr. Anthony Anderson II',
'event_id' => '38',
'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2008-10-21 00:00:00',
- 'event_end_date' => '2008-10-23 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
'participant_id' => '3',
'participant_fee_level' => '',
'participant_fee_amount' => '',
'display_name' => 'Mr. Anthony Anderson II',
'event_id' => '6',
'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2008-10-21 00:00:00',
- 'event_end_date' => '2008-10-23 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
'participant_id' => '1',
'participant_fee_level' => '',
'participant_fee_amount' => '',
'event_type_id' => '1',
'participant_listing_id' => 0,
'is_public' => '1',
- 'start_date' => '2008-10-21 00:00:00',
- 'event_start_date' => '2008-10-21 00:00:00',
- 'end_date' => '2008-10-23 00:00:00',
- 'event_end_date' => '2008-10-23 00:00:00',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
'is_online_registration' => '1',
'registration_start_date' => '2008-06-01 00:00:00',
'registration_end_date' => '2008-10-15 00:00:00',
'display_name' => 'Mr. Anthony Anderson II',
'event_id' => '5',
'event_title' => 'Annual CiviCRM meet',
- 'event_start_date' => '2008-10-21 00:00:00',
- 'event_end_date' => '2008-10-23 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
'participant_id' => '1',
'participant_fee_level' => '',
'participant_fee_amount' => '',
*/
function pledge_get_example(){
$params = array(
- 'pledge_start_date_high' => '20130726201306',
+ 'pledge_start_date_high' => '20130801213843',
);
try{
'display_name' => 'Mr. Anthony Anderson II',
'pledge_id' => '2',
'pledge_amount' => '100.00',
- 'pledge_create_date' => '2013-07-28 00:00:00',
+ 'pledge_create_date' => '2013-08-03 00:00:00',
'pledge_status' => 'Overdue',
'pledge_total_paid' => '',
'pledge_next_pay_date' => '2012-03-02 00:00:00',
function pledge_create_example(){
$params = array(
'contact_id' => 11,
- 'pledge_create_date' => '20130728',
- 'start_date' => '20130728',
- 'scheduled_date' => '20130730',
+ 'pledge_create_date' => '20130803',
+ 'start_date' => '20130803',
+ 'scheduled_date' => '20130805',
'amount' => '100',
'pledge_status_id' => '2',
'pledge_financial_type_id' => '1',
'frequency_interval' => '5',
'frequency_day' => '15',
'installments' => '5',
- 'start_date' => '20130728000000',
+ 'start_date' => '2013-07-29 00:00:00',
'create_date' => '20120130621222105',
'acknowledge_date' => '',
- 'modified_date' => '2012-11-14 16:02:35',
+ 'modified_date' => '',
'cancel_date' => '',
'end_date' => '',
'honor_contact_id' => '',
'display_name' => 'Mr. Anthony Anderson II',
'pledge_id' => '1',
'pledge_amount' => '100.00',
- 'pledge_create_date' => '2013-07-28 00:00:00',
+ 'pledge_create_date' => '2013-08-03 00:00:00',
'pledge_status' => 'Pending',
'pledge_total_paid' => '',
- 'pledge_next_pay_date' => '2013-07-30 00:00:00',
+ 'pledge_next_pay_date' => '2013-08-05 00:00:00',
'pledge_next_pay_amount' => '20.00',
'pledge_outstanding_amount' => '',
'pledge_financial_type' => 'Donation',
'scheduled_amount' => '',
'actual_amount' => '20',
'currency' => 'USD',
- 'scheduled_date' => '20130728085413',
+ 'scheduled_date' => '',
'reminder_date' => '',
'reminder_count' => '',
'status_id' => '1',
'first_name' => 'abc2',
'middle_name' => '',
'last_name' => 'xyz2',
+ 'prefix_id' => '',
+ 'suffix_id' => '',
'email_greeting_id' => '1',
'email_greeting_custom' => '',
'email_greeting_display' => 'Dear abc1',
'postal_greeting_display' => 'Dear abc1',
'addressee_id' => '1',
'addressee_custom' => '',
- 'addressee_display' => '{contact.individual_prefix} abc1 {contact.middle_name} xyz1 {contact.individual_suffix}',
+ 'addressee_display' => '{contact.individual_prefix} abc1 xyz1 {contact.individual_suffix}',
'job_title' => '',
'gender_id' => '',
'birth_date' => '',
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '32',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '33',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '34',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '32',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '33',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '31',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '31',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '63',
'contact_id_b' => '64',
'relationship_type_id' => '34',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '60',
'contact_id_b' => '61',
'relationship_type_id' => '30',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '24',
'contact_id_b' => '25',
'relationship_type_id' => '18',
- 'start_date' => '20101030000000',
- 'end_date' => '20101230000000',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'contact_id_a' => '33',
'contact_id_b' => '34',
'relationship_type_id' => '21',
- 'start_date' => '2008-12-20',
+ 'start_date' => '2013-07-29 00:00:00',
'is_active' => '1',
'description' => '',
'is_permission_a_b' => 0,
'bypass_confirm' => '',
'thankyou_title' => '',
'thankyou_text' => '',
+ 'is_share' => '',
),
),
);
'is_tagset' => '',
'used_for' => 'civicrm_contact',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
),
),
);
'is_reserved' => 0,
'is_tagset' => 0,
'used_for' => 'civicrm_contact',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
),
),
);
'visibility' => 'Public Pages and Listings',
'in_selector' => '',
'is_searchable' => '1',
- 'location_type_id' => 'null',
+ 'location_type_id' => '',
'phone_type_id' => '',
'label' => 'Test First Name',
'field_type' => 'Contact',
'is_active' => 0,
'group_type' => 'Individual,Contact',
'title' => 'Test Group',
+ 'description' => '',
'help_pre' => 'help pre',
'help_post' => 'help post',
'limit_listings_group_id' => '1',
'is_reserved' => '1',
'name' => 'Test_Group_2',
'created_id' => '1',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_proximity_search' => '',
),
),
'is_reserved' => '1',
'name' => 'Test_Group_2',
'created_id' => '1',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_proximity_search' => 0,
),
),
'scheduled_date' => '20130728085413',
'approval_date' => '20130728085413',
'pledge_start_date_high' => '20130726090416',
+ 'start_date' => '2013-07-29 00:00:00',
+ 'event_start_date' => '2013-07-29 00:00:00',
+ 'end_date' => '2013-08-04 00:00:00',
+ 'event_end_date' => '2013-08-04 00:00:00',
+ 'decision_date' => '20130805000000',
);
$keysToUnset = array('xdebug', 'undefined_fields',);
unset($result[$unwantedKey]);
}
}
+ if (isset($result['values'])) {
+ if(!is_array($result['values'])) {
+ return;
+ }
+ $resultArray = &$result['values'];
+ }
+ elseif(is_array($result)) {
+ $resultArray = &$result;
+ }
+ else {
+ return;
+ }
- if (isset($result['values']) && is_array($result['values'])) {
- foreach ($result['values'] as $index => &$values) {
+ foreach ($resultArray as $index => &$values) {
if(!is_array($values)) {
continue;
}
if(in_array($key, $keysToUnset)) {
unset($values[$key]);
}
- if(array_key_exists($key, $fieldsToChange)) {
+ if(array_key_exists($key, $fieldsToChange) && !empty($value)) {
$value = $fieldsToChange[$key];
}
}
- }
}
}
protected $_apiversion = 3;
protected $test_activity_type_value;
protected $_contactID;
+
public $_eNoticeCompliant = TRUE;
/**
* Test setup for every test
'civicrm_activity_contact',
);
$this->quickCleanup($tablesToTruncate, TRUE);
- $this->callAPISuccess('option_value', 'delete', array('version' => 3, 'id' => $this->test_activity_type_id));
+ $this->callAPISuccess('option_value', 'delete', array('id' => $this->test_activity_type_id));
}
/**
* check with empty array
*/
function testActivityCreateEmpty() {
- $params = array('version' => $this->_apiversion);
- $result = $this->callAPIFailure('activity', 'create', $params);
+ $result = $this->callAPIFailure('activity', 'create', array());
}
/**
$params = array(
'subject' => 'this case should fail',
'scheduled_date_time' => date('Ymd'),
- 'version' => $this->_apiversion,
);
-
$result = $this->callAPIFailure('activity', 'create', $params);
}
'activity_name' => 'Fubar activity type',
'activity_type_id' => 5,
'scheduled_date_time' => date('Ymd'),
- 'version' => $this->_apiversion,
);
$result = $this->callAPIFailure('activity', 'create', $params);
$result = $this->callAPIFailure('activity', 'create', $params);
}
-
/**
* Ensure that an invalid activity type causes failure
* oddly enough this test was failing because the creation of the invalid type
'details' => 'a test activity',
'status_id' => 1,
'activity_type_id' => 'Invalid Test activity type',
- 'version' => $this->_apiversion,
);
$result = $this->callAPIFailure('activity', 'create', $params);
* Test civicrm_activity_create() with valid parameters - use type_id
*/
function testActivityCreateCampaignTypeID() {
+ CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign');
// force reload of config object
$config = CRM_Core_Config::singleton(TRUE, TRUE);
-
- CRM_Core_BAO_ConfigSetting::enableComponent('CiviCampaign');
//flush cache by calling with reset
$activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name', TRUE);
'assignee_contact_id' => $this->_contactID,
);
- $result = $this->callAPISuccess('activity', 'create', $params);
- //todo test target & assignee are set
-
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, $description, $subfile);
+ $result = $this->callAPIAndDocument('activity', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
$result = $this->callAPISuccess('activity', 'get', array('id' => $result['id'], 'version' => $this->_apiversion, 'return.assignee_contact_id' => 1, 'return.target_contact_id' => 1));
$this->assertEquals($this->_contactID, $result['values'][$result['id']]['assignee_contact_id'][0], 'in line ' . __LINE__);
$ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__);
$params = $this->_params;
$params['custom_' . $ids['custom_field_id']] = "custom string";
- $result = $this->callAPISuccess($this->_entity, 'create', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__);
+ $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
$result = $this->callAPISuccess($this->_entity, 'get', array('return.custom_' . $ids['custom_field_id'] => 1, 'version' => 3, 'id' => $result['id']));
$this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$params = $this->_params;
$params['custom_' . $customField['id']] = "$this->_contactID";
- $result = $this->callAPISuccess($this->_entity, 'create', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, $description, $subfile);
- $result = $this->callAPISuccess($this->_entity, 'get', array('return.custom_' . $customField['id'] => 1, 'version' => 3, 'id' => $result['id']));
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet');
+ $result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create');
+ $result = $this->callAPIAndDocument($this->_entity, 'get', array('return.custom_' . $customField['id'] => 1, 'id' => $result['id']), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
$this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']], ' in line ' . __LINE__);
$this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__);
),
);
- $result = $this->callAPISuccess('Activity', 'Get', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, $description, $subfile);
-
- $this->assertAPISuccess($result);
+ $result = $this->callAPIAndDocument('Activity', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals($activity['id'], $result['id'], 'In line ' . __LINE__);
'details' => 'a test activity',
'status_id' => 1,
'activity_name' => 'Test activity type',
- 'version' => $this->_apiversion,
'priority_id' => 1,
);
- $this->callAPISuccess('Activity', 'Create', $params);
- $result = $this->callAPISuccess('Activity', 'Get', array('version' => 3, 'subject' => 'Make-it-Happen Meeting'));
+ $result = $this->callAPISuccess('Activity', 'Create', $params);
+ $this->callAPISuccess('Activity', 'Get', array('subject' => 'Make-it-Happen Meeting'));
$this->assertEquals(1, $result['count']);
$this->assertEquals('Make-it-Happen Meeting', $result['values'][$result['id']]['subject']);
- $this->callAPISuccess('Activity', 'Delete', array('version' => 3, 'id' => $result['id']));
+ $this->callAPISuccess('Activity', 'Delete', array('id' => $result['id']));
}
/*
* test that get functioning does filtering
'filter.activity_date_time_low' => '20120101000000',
'sequential' => 1,
);
- $result = $this->callAPISuccess('Activity', 'Get', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, $description, $subfile);
+ $result = $this->callAPIAndDocument('Activity', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals(1, $result['count'], 'in line ' . __LINE__);
$description = "demonstrates _high filter (at time of writing doesn't work if contact_id is set";
$subfile = "DateTimeHigh";
'filter.activity_date_time_high' => '20120101000000',
'sequential' => 1,
);
- $result = $this->callAPISuccess('Activity', 'Get', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, $description, $subfile);
+ $result = $this->callAPIAndDocument('Activity', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals(1, $result['count']);
$this->assertEquals('2011-01-01 00:00:00', $result['values'][0]['activity_date_time'], 'in line ' . __LINE__);
$params['custom_' . $ids['custom_field_id']] = "custom string";
$result = $this->callAPISuccess($this->_entity, 'create', $params);
- $this->assertAPISuccess($result, ' in line ' . __LINE__);
+
// Retrieve the test value
$params = array(
'activity_type_id' => $this->test_activity_type_value,
- 'version' => 3,
'sequential' => 1,
'return.custom_' . $ids['custom_field_id'] => 1,
);
- $result = $this->callAPISuccess('activity', 'get', $params, TRUE);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, ' in line ' . __LINE__);
- $this->assertEquals("custom string", $result['values'][0]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
+ $result = $this->callAPIAndDocument('activity', 'get', $params, __FUNCTION__, __FILE__);
+ $this->assertEquals("custom string", $result['values'][0]['custom_' . $ids['custom_field_id']]);
-
- $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id'], 'In line ' . __LINE__);
+ $this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id']);
$this->assertEquals('test activity type id', $result['values'][0]['subject'], 'In line ' . __LINE__);
$this->customFieldDelete($ids['custom_field_id']);
$this->customGroupDelete($ids['custom_group_id']);
$params = array(
'contact_id' => $this->_params['source_contact_id'],
'activity_type_id' => $this->test_activity_type_value,
- 'version' => 3,
'sequential' => 1,
'return.custom_' . $ids['custom_field_id'] => 1,
);
- $result = $this->callAPISuccess('activity', 'get', $params, TRUE);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result);
+ $result = $this->callAPIAndDocument('activity', 'get', $params, __FUNCTION__, __FILE__);
$this->assertEquals("custom string", $result['values'][0]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$this->assertEquals($this->test_activity_type_value, $result['values'][0]['activity_type_id'], 'In line ' . __LINE__);
$result = $this->callAPISuccess('activity', 'delete', $params);
$this->documentMe($params, $result, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result);
}
/**
'status_id' => 1,
'source_contact_id' => $this->_contactID,
'priority_id' => 1,
- 'version' => $this->_apiversion,
);
$result = $this->callAPISuccess('activity', 'create', $params);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
//hack on date comparison - really we should make getAndCheck smarter to handle dates
$params['activity_date_time'] = '2009-10-11 12:34:56';
// we also unset source_contact_id since it is stored in an aux table
$result = $this->callAPISuccess('activity', 'create', $params);
$activityId = $result['id'];
- $this->assertAPISuccess($result);
$result = $this->callAPISuccess($this->_entity, 'get', array('return.custom_' . $ids['custom_field_id'] => 1, 'version' => 3, 'id' => $result['id']));
$this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$this->assertEquals("2009-10-18 00:00:00", $result['values'][$result['id']]['activity_date_time'], ' in line ' . __LINE__);
'version' => $this->_apiversion,
);
$result = $this->callAPISuccess('Activity', 'Create', $params);
- $this->assertAPISuccess($result);
$result = $this->callAPISuccess($this->_entity, 'get', array('return.custom_' . $ids['custom_field_id'] => 1, 'version' => 3, 'id' => $result['id']));
$this->assertEquals("Updated my test data", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$result = $this->callAPISuccess('Activity', 'Create', $params);
$activityId = $result['id'];
- $this->assertAPISuccess($result);
$getParams = array(
'return.assignee_contact_id' => 1,
'return.target_contact_id' => 1,
$params = array();
$params['id'] = $activityId;
- $params['version'] = $this->_apiversion;
$params['assignee_contact_id'] = array($contact3 => $contact3);
$params['target_contact_id'] = array($contact4 => $contact4);
$result = $this->callAPISuccess('activity', 'create', $params);
- $this->assertAPISuccess($result);
$this->assertEquals($activityId, $result['id'], ' in line ' . __LINE__);
'return.assignee_contact_id' => 1,
'return.target_contact_id' => 1,
'return.source_contact_id' => 1,
- 'version' => 3,
'id' => $result['id']
)
);
$this->assertEquals(TRUE, in_array($contact4, $target), ' in line ' . __LINE__);
foreach ($this->_params as $fld => $val) {
- if ($fld == 'version') {
- continue;
- }
- $this->assertEquals($val, $result['values'][$result['id']][$fld], ' in line ' . __LINE__);
+ $this->assertEquals($val, $result['values'][$result['id']][$fld]);
}
}
'status_id' => 1,
'source_contact_id' => $this->_contactID,
'priority_id' => 1,
- 'version' => $this->_apiversion,
);
$result = $this->callAPISuccess('activity', 'create', $params);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
//hack on date comparison - really we should make getAndCheck smarter to handle dates
$params['activity_date_time'] = $this->_params['activity_date_time'];
// we also unset source_contact_id since it is stored in an aux table
*/
function testActivityUpdateWithStatus() {
$activity = $this->callAPISuccess('activity', 'create', $this->_params);
- $this->assertAPISuccess($activity, "In line " . __LINE__);
$params = array(
'id' => $activity['id'],
'source_contact_id' => $this->_contactID,
'subject' => 'Hurry update works',
'status_id' => 1,
'activity_name' => 'Test activity type',
- 'version' => $this->_apiversion,
);
$result = $this->callAPISuccess('activity', 'create', $params);
- $this->assertAPISuccess($result, "In line " . __LINE__);
- $this->assertEquals($result['id'], $activity['id'], "In line " . __LINE__);
- /*$this->assertEquals($result['values'][$activity['id']]['source_contact_id'], $this->_contactID,
- "In line " . __LINE__
- );*/
- $this->assertEquals($result['values'][$activity['id']]['subject'], 'Hurry update works',
- "In line " . __LINE__
- );
- $this->assertEquals($result['values'][$activity['id']]['status_id'], 1,
- "In line " . __LINE__
+ $this->assertEquals($result['id'], $activity['id']);
+ $this->assertEquals($result['values'][$activity['id']]['subject'], 'Hurry update works');
+ $this->assertEquals($result['values'][$activity['id']]['status_id'], 1
);
}
'status_id' => 1,
'activity_name' => 'Test activity type',
'priority_id' => 1,
- 'version' => $this->_apiversion,
);
$result = $this->callAPISuccess('activity', 'create', $params);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
- $findactivity = $this->callAPISuccess('Activity', 'Get', array('id' => $activity['id'], 'version' => 3));
-
- $this->assertAPISuccess($findactivity);
+ $findactivity = $this->callAPISuccess('Activity', 'Get', array('id' => $activity['id']));
}
/**
));
$result = $this->callAPISuccess('Activity', 'Get', array(
- 'version' => 3,
'id' => $activity['id'],
'return.assignee_contact_id' => 1,
'api.contact.get' => array('api.pledge.get' => 1),
function testGetFields() {
$params = array('action' => 'create');
- $result = $this->callAPISuccess('activity', 'getfields', $params);
- $this->documentMe($params, $result, __FUNCTION__, __FILE__, NULL, NULL, 'getfields');
+ $result = $this->callAPIAndDocument('activity', 'getfields', $params, __FUNCTION__, __FILE__, NULL, NULL, 'getfields');
$this->assertTrue(is_array($result['values']), 'get fields doesnt return values array in line ' . __LINE__);
// $this->assertTrue(is_array($result['values']['priority_id']['options']));
foreach ($result['values'] as $key => $value) {
$description = "demonstrates use of is.Current option";
$subfile = "IsCurrentOption";
$result = $this->callAPIAndDocument('Event', 'Get', $params, __FUNCTION__, __FILE__, $description, $subfile);
- $allEvents = $this->callAPISuccess('Event', 'Get', array('version' => 3));
- $this->callAPISuccess('Event', 'Delete', array('version' => 3, 'id' => $currentEvent['id']));
+ $allEvents = $this->callAPISuccess('Event', 'Get', array());
+ $this->callAPISuccess('Event', 'Delete', array('id' => $currentEvent['id']));
$this->assertEquals(1, $result['count'], 'confirm only one event found in line ' . __LINE__);
$this->assertEquals(3, $allEvents['count'], 'confirm three events exist (ie. two not found) ' . __LINE__);
$this->assertEquals($currentEvent['id'], $result['id'], '');
$params = array(
'email' => $this->_email,
'group_id' => $this->_groupID,
- 'contact_id' => $contactID, 'hash' => 'b15de8b64e2cec34',
+ 'contact_id' => $contactID,
+ 'hash' => 'b15de8b64e2cec34',
'time_stamp' => '20101212121212',
);
$result = $this->callAPIAndDocument('mailing_event_subscribe', 'create', $params, __FUNCTION__, __FILE__);