'title' => 'New Batch 03',
'description' => 'This is description for New Batch 03',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_id' => '',
'modified_date' => '2012-11-14 16:02:35',
'saved_search_id' => '',
'title' => 'New Batch 04',
'description' => 'This is description for New Batch 04',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_id' => '',
'modified_date' => '2012-11-14 16:02:35',
'saved_search_id' => '',
'parent_id' => '',
'is_active' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'last_modified_id' => '',
'last_modified_date' => '',
'goal_general' => '',
'title' => 'campaign title',
'description' => 'Call people, ask for money',
'is_active' => '1',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
),
),
);
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
'api.tag.create' => 6,
'api.entity_tag.create' => array(
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
'api.contribution.create' => array(
'is_error' => 0,
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
'api.contribution.create' => array(
'is_error' => 0,
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
),
),
'start_date' => '',
'end_date' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'currency' => 'NZD',
'campaign_id' => '',
'is_share' => '',
'max_multiple' => 'null',
'collapse_adv_display' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_reserved' => '',
),
),
'is_multiple_registrations' => 0,
'allow_same_participant_emails' => 0,
'is_template' => 0,
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
),
),
'is_multiple_registrations' => 0,
'allow_same_participant_emails' => 0,
'is_template' => 0,
- 'created_date' => '2013-07-28 08:49:19',
+ 'created_date' => '2013-07-28 19:57:44',
'is_share' => '1',
'available_places' => 0,
'is_full' => '1',
'is_template' => 0,
'template_title' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'currency' => '',
'campaign_id' => '',
'is_share' => '',
'is_multiple_registrations' => 0,
'allow_same_participant_emails' => 0,
'is_template' => 0,
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
),
),
'2' => array(
'id' => '2',
'contact_id' => '4',
- 'application_received_date' => '2013-07-28',
+ 'application_received_date' => '20130728084957',
'decision_date' => '2013-07-29',
'grant_type_id' => '1',
'amount_total' => '500.00',
'msg_template_id' => '',
'override_verp' => '1',
'created_id' => '1',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'scheduled_id' => '',
'scheduled_date' => '20130728085413',
'approver_id' => '1',
'values' => array(
'contact_id' => '3',
'subscribe_id' => '1',
- 'hash' => 'fcf4e727e2a34e5d',
+ 'hash' => 'bf4d724dbbb38c0c',
'is_error' => 0,
),
);
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
'api.participant' => 4,
'api.contribution.create' => 1,
'is_multiple_registrations' => 0,
'allow_same_participant_emails' => 0,
'is_template' => 0,
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'is_share' => '1',
),
),
*/
function pledge_get_example(){
$params = array(
- 'pledge_start_date_high' => '20130726090416',
+ 'pledge_start_date_high' => '20130726201306',
);
try{
'scheduled_amount' => '',
'actual_amount' => '20',
'currency' => 'USD',
- 'scheduled_date' => '',
+ 'scheduled_date' => '20130728085413',
'reminder_date' => '',
'reminder_count' => '',
'status_id' => '1',
'pledge_id' => '1',
'scheduled_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '2013-07-28 00:00:00',
+ 'scheduled_date' => '20130728085413',
'reminder_count' => 0,
'status_id' => '2',
),
'pledge_id' => '1',
'scheduled_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '2018-07-28 00:00:00',
+ 'scheduled_date' => '20130728085413',
'reminder_count' => 0,
'status_id' => '2',
),
'pledge_id' => '1',
'scheduled_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '2023-07-28 00:00:00',
+ 'scheduled_date' => '20130728085413',
'reminder_count' => 0,
'status_id' => '2',
),
'pledge_id' => '1',
'scheduled_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '2028-07-28 00:00:00',
+ 'scheduled_date' => '20130728085413',
'reminder_count' => 0,
'status_id' => '2',
),
'pledge_id' => '1',
'scheduled_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '2033-07-28 00:00:00',
+ 'scheduled_date' => '20130728085413',
'reminder_count' => 0,
'status_id' => '2',
),
'scheduled_amount' => '20.00',
'actual_amount' => '20.00',
'currency' => 'USD',
- 'scheduled_date' => '20130728000000',
+ 'scheduled_date' => '20130728085413',
'reminder_date' => '',
'reminder_count' => 0,
'status_id' => '1',
$expectedResult = array(
'is_error' => 0,
'version' => 3,
- 'count' => 10,
+ 'count' => 11,
'values' => array(
'contact_type' => 'Individual',
'contact_sub_type' => '',
'contact_id' => 1,
- 'profile_id' => 25,
'version' => 3,
+ 'debug' => 1,
+ 'profile_id' => 25,
'first_name' => 'abc2',
'last_name' => 'xyz2',
'email' => array(
'organization_name' => '',
'sic_code' => '',
'user_unique_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'modified_date' => '2012-11-14 16:02:35',
),
),
'max_number_of_contacts' => '12',
'is_active' => '1',
'is_default' => 0,
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'bypass_confirm' => 0,
'api.survey.delete' => array(
'is_error' => 0,
'is_active' => '',
'is_default' => '',
'created_id' => '',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'last_modified_id' => '',
'last_modified_date' => '',
'result_id' => '',
'max_number_of_contacts' => '12',
'is_active' => '1',
'is_default' => 0,
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'bypass_confirm' => 0,
),
),
function uf_group_create_example(){
$params = array(
'add_captcha' => 1,
- 'add_contact_to_group' => 2,
+ 'add_contact_to_group' => 1,
+ 'group' => 1,
'cancel_URL' => 'http://example.org/cancel',
'created_date' => '2009-06-27 00:00:00',
- 'created_id' => 69,
- 'group' => 2,
+ 'created_id' => 1,
'group_type' => 'Individual,Contact',
'help_post' => 'help post',
'help_pre' => 'help pre',
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 12,
+ 'id' => 2,
'values' => array(
- '12' => array(
- 'id' => '12',
+ '2' => array(
+ 'id' => '2',
'is_active' => 0,
'group_type' => 'Individual,Contact',
'title' => 'Test Group',
'help_pre' => 'help pre',
'help_post' => 'help post',
- 'limit_listings_group_id' => '2',
+ 'limit_listings_group_id' => '1',
'post_URL' => 'http://example.org/post',
- 'add_to_group_id' => '2',
+ 'add_to_group_id' => '1',
'add_captcha' => '1',
'is_map' => '1',
'is_edit_link' => '1',
'is_cms_user' => '1',
'notify' => 'admin@example.org',
'is_reserved' => '1',
- 'name' => 'Test_Group_12',
- 'created_id' => '69',
+ 'name' => 'Test_Group_2',
+ 'created_id' => '1',
'created_date' => '2013-07-28 05:52:14',
'is_proximity_search' => '',
),
*/
function uf_group_delete_example(){
$params = array(
- 'add_captcha' => 1,
- 'add_contact_to_group' => 2,
- 'cancel_URL' => 'http://example.org/cancel',
- 'created_date' => '2009-06-27 00:00:00',
- 'created_id' => 69,
- 'group' => 2,
- 'group_type' => 'Individual,Contact',
- 'help_post' => 'help post',
- 'help_pre' => 'help pre',
- 'is_active' => 0,
- 'is_cms_user' => 1,
- 'is_edit_link' => 1,
- 'is_map' => 1,
- 'is_reserved' => 1,
- 'is_uf_link' => 1,
- 'is_update_dupe' => 1,
- 'name' => 'Test_Group',
- 'notify' => 'admin@example.org',
- 'post_URL' => 'http://example.org/post',
- 'title' => 'Test Group',
+ 'id' => 2,
);
try{
*/
function uf_group_get_example(){
$params = array(
- 'add_captcha' => 1,
- 'add_contact_to_group' => 2,
- 'cancel_URL' => 'http://example.org/cancel',
- 'created_date' => '2009-06-27 00:00:00',
- 'created_id' => 69,
- 'group' => 2,
- 'group_type' => 'Individual,Contact',
- 'help_post' => 'help post',
- 'help_pre' => 'help pre',
- 'is_active' => 0,
- 'is_cms_user' => 1,
- 'is_edit_link' => 1,
- 'is_map' => 1,
- 'is_reserved' => 1,
- 'is_uf_link' => 1,
- 'is_update_dupe' => 1,
- 'name' => 'Test_Group',
- 'notify' => 'admin@example.org',
- 'post_URL' => 'http://example.org/post',
- 'title' => 'Test Group',
+ 'id' => 2,
);
try{
'is_error' => 0,
'version' => 3,
'count' => 1,
- 'id' => 12,
+ 'id' => 2,
'values' => array(
- '12' => array(
- 'id' => '12',
+ '2' => array(
+ 'id' => '2',
'is_active' => 0,
'group_type' => 'Individual,Contact',
'title' => 'Test Group',
'help_pre' => 'help pre',
'help_post' => 'help post',
- 'limit_listings_group_id' => '2',
+ 'limit_listings_group_id' => '1',
'post_URL' => 'http://example.org/post',
- 'add_to_group_id' => '2',
+ 'add_to_group_id' => '1',
'add_captcha' => '1',
'is_map' => '1',
'is_edit_link' => '1',
'is_cms_user' => '1',
'notify' => 'admin@example.org',
'is_reserved' => '1',
- 'name' => 'Test_Group_12',
- 'created_id' => '69',
+ 'name' => 'Test_Group_2',
+ 'created_id' => '1',
'created_date' => '2013-07-28 05:52:14',
'is_proximity_search' => 0,
),
$fieldsToChange = array(
'hash' => '67eac7789eaee00',
'modified_date' => '2012-11-14 16:02:35',
- 'created_date' => '2013-07-28 05:52:14',
+ 'created_date' => '2013-07-28 08:49:19',
'create_date' => '20120130621222105',
+ 'application_received_date' => '20130728084957',
+ 'in_date' => '2013-07-28 08:50:19',
+ 'scheduled_date' => '20130728085413',
+ 'approval_date' => '20130728085413',
+ 'pledge_start_date_high' => '20130726090416',
);
$keysToUnset = array('xdebug', 'undefined_fields',);
* @dataProvider entities_create
*/
public function testEmptyParam_create($Entity) {
- $this->markTestIncomplete("fixing this test to test the api functions fails on numberous tests
- which will either create a completely blank entity (batch, participant status) or
+ $this->markTestIncomplete("fixing this test to test the api functions fails on numberous tests
+ which will either create a completely blank entity (batch, participant status) or
have a damn good crack at it (e.g mailing job). Marking this as incomplete beats false success");
- //
+ //
return;
if (in_array($Entity, $this->toBeImplemented['create'])) {
// $this->markTestIncomplete("civicrm_api3_{$Entity}_create to be implemented");
if (!empty($specs['pseudoconstant']) || !empty($specs['enumValues'])) {
$options = civicrm_api($entityName, 'getoptions', array('context' => 'create', 'field' => $field, 'version' => 3));
if (empty($options['values'])) {
- print_r($options);
}
$entity[$field] = array_rand($options['values']);
}
$field => $entity[$field],
);
- $update = civicrm_api($entityName, 'create', $updateParams);
- if(!empty($update['is_error'])){
- print_r($update);
- }
- $this->assertAPISuccess($update, print_r($updateParams, TRUE) . 'in line ' . __LINE__);
+ $update = $this->callAPISuccess($entityName, 'create', $updateParams);
$checkParams = array(
'id' => $entity['id'],
'version' => 3,
),
);
- $checkEntity = civicrm_api($entityName, 'getsingle', $checkParams);
- $this->assertEquals($entity, $checkEntity, "changing field $fieldName\n" .
- print_r($entity, TRUE)
+ $checkEntity = $this->callAPISuccess($entityName, 'getsingle', $checkParams);
+ $this->assertAPIArrayComparison($entity, $checkEntity, array(), "changing field $fieldName\n");
//print_r(array('update-params' => $updateParams, 'update-result' => $update, 'getsingle-params' => $checkParams, 'getsingle-result' => $checkEntity, 'expected entity' => $entity), TRUE)
- );
}
$baoObj->deleteTestObjects($baoString);