//since we are loading activities from dataset, we know total number of activities
// 8 schedule activities that should be shown on dashboard
$count = 8;
- $this->assertEquals($count, $activityCount, 'In line ' . __LINE__);
+ $this->assertEquals($count, $activityCount);
}
/**
//since we are loading activities from dataset, we know total number of activities for this contact
// 5 activities ( 2 scheduled, 3 Completed ), note that dashboard shows only scheduled activities
$count = 2;
- $this->assertEquals($count, $activityCount, 'In line ' . __LINE__);
+ $this->assertEquals($count, $activityCount);
}
/**
//since we are loading activities from dataset, we know total number of activities for this contact
// 5 activities, Contact Summary should show all activities
$count = 5;
- $this->assertEquals($count, $activityCount, 'In line ' . __LINE__);
+ $this->assertEquals($count, $activityCount);
}
/**
//since we are loading activities from dataset, we know total number of activities for this contact
// this contact does not have any activity
- $this->assertEquals(0, $activityCount, 'In line ' . __LINE__);
+ $this->assertEquals(0, $activityCount);
}
/**
$indiviParent = $result['values'][$this->indiviParent];
//asserts for type:Individual
- $this->assertEquals($individual['contact_id'], $this->individual, 'In line ' . __LINE__);
+ $this->assertEquals($individual['contact_id'], $this->individual);
$this->assertEquals($individual['first_name'], $this->indiviParams['first_name']);
$this->assertEquals($individual['contact_type'], $this->indiviParams['contact_type']);
$this->assertNotContains('contact_sub_type', $individual);
//asserts for type:Individual subtype:Student
- $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__);
+ $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent);
$this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']);
$this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']);
$this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']);
//asserts for type:Individual subtype:Parent
- $this->assertEquals($indiviParent['contact_id'], $this->indiviParent, 'In line ' . __LINE__);
+ $this->assertEquals($indiviParent['contact_id'], $this->indiviParent);
$this->assertEquals($indiviParent['first_name'], $this->indiviParentParams['first_name']);
$this->assertEquals($indiviParent['contact_type'], $this->indiviParentParams['contact_type']);
$this->assertEquals(end($indiviParent['contact_sub_type']), $this->indiviParentParams['contact_sub_type']);
$orgSponsor = $result['values'][$this->orgSponsor];
//asserts for type:Organization
- $this->assertEquals($organization['contact_id'], $this->organization, 'In line ' . __LINE__);
+ $this->assertEquals($organization['contact_id'], $this->organization);
$this->assertEquals($organization['organization_name'], $this->organizationParams['organization_name']);
$this->assertEquals($organization['contact_type'], $this->organizationParams['contact_type']);
$this->assertNotContains('contact_sub_type', $organization);
//asserts for type:Organization subtype:Sponsor
- $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__);
+ $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor);
$this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']);
$this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']);
$this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']);
$household = $result['values'][$this->household];
//asserts for type:Household
- $this->assertEquals($household['contact_id'], $this->household, 'In line ' . __LINE__);
+ $this->assertEquals($household['contact_id'], $this->household);
$this->assertEquals($household['household_name'], $this->householdParams['household_name']);
$this->assertEquals($household['contact_type'], $this->householdParams['contact_type']);
$this->assertNotContains('contact_sub_type', $household);
$indiviStudent = $result['values'][$this->indiviStudent];
//asserts for type:Individual subtype:Student
- $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__);
+ $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent);
$this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']);
$this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']);
$this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']);
$orgSponsor = $result['values'][$this->orgSponsor];
//asserts for type:Organization subtype:Sponsor
- $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__);
+ $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor);
$this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']);
$this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']);
$this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']);
$indiviStudent = $result['values'][$this->indiviStudent];
//asserts for type:Individual subtype:Student
- $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent, 'In line ' . __LINE__);
+ $this->assertEquals($indiviStudent['contact_id'], $this->indiviStudent);
$this->assertEquals($indiviStudent['first_name'], $this->indiviStudentParams['first_name']);
$this->assertEquals($indiviStudent['contact_type'], $this->indiviStudentParams['contact_type']);
$this->assertEquals(end($indiviStudent['contact_sub_type']), $this->indiviStudentParams['contact_sub_type']);
$orgSponsor = $result['values'][$this->orgSponsor];
//asserts for type:Organization subtype:Sponsor
- $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor, 'In line ' . __LINE__);
+ $this->assertEquals($orgSponsor['contact_id'], $this->orgSponsor);
$this->assertEquals($orgSponsor['organization_name'], $this->orgSponsorParams['organization_name']);
$this->assertEquals($orgSponsor['contact_type'], $this->orgSponsorParams['contact_type']);
$this->assertEquals(end($orgSponsor['contact_sub_type']), $this->orgSponsorParams['contact_sub_type']);
// for invalid type
$params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for invalid subtype
$params = array('contact_sub_type' => 'Invalid', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for invalid contact type as well as subtype
$params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for valid type and invalid subtype
$params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for invalid type and valid subtype
$params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'indivi_student', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
}
/**
$defaults = array();
$params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for type:Orgaization subtype:Parent
$params = array('contact_type' => 'Orgaization' . CRM_Core_DAO::VALUE_SEPARATOR . $this->parent, 'version' => 3);
$result = civicrm_api('contact', 'get', $params, $defaults);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for type:Household subtype:Sponsor
$params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3);
$result = civicrm_api('contact', 'get', $params, $defaults);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
// for type:Household subtype:Student
$params = array('contact_type' => 'Household' . CRM_Core_DAO::VALUE_SEPARATOR . $this->student, 'version' => 3);
$result = civicrm_api('contact', 'get', $params, $defaults);
- $this->assertEquals(empty($result['values']), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result['values']), TRUE);
}
}
}
$this->assertEquals($contact->first_name, 'Bill');
$this->assertEquals($contact->contact_type, 'Individual');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->student, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->student);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
//check for Type:Organization, Subtype:Sponsor
}
$this->assertEquals($contact->organization_name, 'Conservation Corp');
$this->assertEquals($contact->contact_type, 'Organization');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->sponsor);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
}
}
catch (Exception$expected) {
}
- $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
+ $this->assertEquals($updatedContact->id, $contact->id);
$this->assertEquals($updatedContact->contact_type, 'Individual');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
$params = array(
}
catch (Exception$expected) {
}
- $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
+ $this->assertEquals($updatedContact->id, $contact->id);
$this->assertEquals($updatedContact->contact_type, 'Organization');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
}
}
catch (Exception$expected) {
}
- $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
+ $this->assertEquals($updatedContact->id, $contact->id);
$this->assertEquals($updatedContact->contact_type, 'Individual');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
$params = array(
catch (Exception$expected) {
}
- $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
+ $this->assertEquals($updatedContact->id, $contact->id);
$this->assertEquals($updatedContact->contact_type, 'Organization');
- $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team, 'In line ' . __LINE__);
+ $this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->team);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
$params = array(
catch (Exception$expected) {
}
- $this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
+ $this->assertEquals($updatedContact->id, $contact->id);
$this->assertEquals($updatedContact->contact_type, 'Individual');
$this->assertEquals($updatedContact->contact_sub_type, 'null');
CRM_Contact_BAO_Contact::deleteContact($contact->id);
$contactTypes = array('Individual', 'Organization', 'Household');
$result = CRM_Contact_BAO_ContactType::contactTypes('Individual');
foreach ($contactTypes as $type) {
- $this->assertEquals(in_array($type, $result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($type, $result), TRUE);
}
// check for type:Individual
foreach ($result as $subtype) {
$subTypeName = in_array($subtype, $this->subTypesIndividual);
if (!empty($subTypeName)) {
- $this->assertEquals($subTypeName, TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($subTypeName, TRUE);
}
- $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE, 'In line ' . __LINE__);
- $this->assertEquals(in_array($subtype, $this->subTypesHousehold), FALSE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE);
+ $this->assertEquals(in_array($subtype, $this->subTypesHousehold), FALSE);
}
// check for type:Organization
$result = CRM_Contact_BAO_ContactType::subTypes('Organization');
foreach ($result as $subtype) {
- $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE);
$subTypeName = in_array($subtype, $this->subTypesOrganization);
if (!empty($subTypeName)) {
- $this->assertEquals($subTypeName, TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($subTypeName, TRUE);
}
$subTypeName = in_array($subTypeName, $this->subTypesHousehold);
if (empty($subTypeName)) {
- $this->assertEquals($subTypeName, FALSE, 'In line ' . __LINE__);
+ $this->assertEquals($subTypeName, FALSE);
}
}
// check for type:Household
$result = CRM_Contact_BAO_ContactType::subTypes('Household');
foreach ($result as $subtype) {
- $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE, 'In line ' . __LINE__);
- $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE, 'In line ' . __LINE__);
- $this->assertEquals(in_array($subtype, $this->subTypesHousehold), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $this->subTypesIndividual), FALSE);
+ $this->assertEquals(in_array($subtype, $this->subTypesOrganization), FALSE);
+ $this->assertEquals(in_array($subtype, $this->subTypesHousehold), TRUE);
}
// check for all conatct types
$result = CRM_Contact_BAO_ContactType::subTypes();
foreach ($this->subTypesIndividual as $subtype) {
- $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $result), TRUE);
}
foreach ($this->subTypesOrganization as $subtype) {
- $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $result), TRUE);
}
foreach ($this->subTypesHousehold as $subtype) {
- $this->assertEquals(in_array($subtype, $result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(in_array($subtype, $result), TRUE);
}
}
$params = 'invalid';
$result = CRM_Contact_BAO_ContactType::subTypes($params);
- $this->assertEquals(empty($result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result), TRUE);
$params = array('invalid');
$result = CRM_Contact_BAO_ContactType::subTypes($params);
- $this->assertEquals(empty($result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals(empty($result), TRUE);
}
/**
'is_active' => 1,
);
$result = CRM_Contact_BAO_ContactType::add($params);
- $this->assertEquals($result, NULL, 'In line ' . __LINE__);
+ $this->assertEquals($result, NULL);
}
public function testAddInvalid2() {
'is_active' => 1,
);
$result = CRM_Contact_BAO_ContactType::add($params);
- $this->assertEquals($result, NULL, 'In line ' . __LINE__);
+ $this->assertEquals($result, NULL);
}
public function testAddInvalid3() {
$del = CRM_Contact_BAO_ContactType::del($subtype->id);
$result = CRM_Contact_BAO_ContactType::subTypes();
- $this->assertEquals($del, TRUE, 'In line ' . __LINE__);
- $this->assertEquals(in_array($subtype->name, $result), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($del, TRUE);
+ $this->assertEquals(in_array($subtype->name, $result), TRUE);
}
/**
public function testDelInvalid() {
$del = CRM_Contact_BAO_ContactType::del(NULL);
- $this->assertEquals($del, FALSE, 'In line ' . __LINE__);
+ $this->assertEquals($del, FALSE);
}
}
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($invalid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($invalid, 1);
+ $this->assertEquals(empty($relationshipIds), TRUE);
$this->relationshipTypeDelete($relType->id);
}
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($invalid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($invalid, 1);
+ $this->assertEquals(empty($relationshipIds), TRUE);
$this->relationshipTypeDelete($relType->id);
}
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($invalid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), TRUE, 'In line ' . __LINE__);
+ $this->assertEquals($invalid, 1);
+ $this->assertEquals(empty($relationshipIds), TRUE);
$this->relationshipTypeDelete($relType->id);
}
$ids = array('contact' => $this->individual);
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($valid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__);
+ $this->assertEquals($valid, 1);
+ $this->assertEquals(empty($relationshipIds), FALSE);
$this->relationshipTypeDelete($relType->id);
}
$ids = array('contact' => $this->organization_sponsor);
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($valid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__);
+ $this->assertEquals($valid, 1);
+ $this->assertEquals(empty($relationshipIds), FALSE);
$this->relationshipTypeDelete($relType->id);
}
$ids = array('contact' => $this->indivi_student);
list($valid, $invalid, $duplicate, $saved, $relationshipIds) = CRM_Contact_BAO_Relationship::legacyCreateMultiple($params, $ids);
- $this->assertEquals($valid, 1, 'In line ' . __LINE__);
- $this->assertEquals(empty($relationshipIds), FALSE, 'In line ' . __LINE__);
+ $this->assertEquals($valid, 1);
+ $this->assertEquals(empty($relationshipIds), FALSE);
$this->relationshipTypeDelete($relType->id);
}
sort($contacts, SORT_NUMERIC);
- $this->assertEquals($ids, $contacts, 'In line ' . __LINE__);
+ $this->assertEquals($ids, $contacts);
}
/**
);
}
asort($all);
- $this->assertEquals($full, $all, 'In line ' . __LINE__);
+ $this->assertEquals($full, $all);
}
/**
}
$contacts = array_keys($contacts);
sort($contacts, SORT_NUMERIC);
- $this->assertEquals($ids, $contacts, 'In line ' . __LINE__);
+ $this->assertEquals($ids, $contacts);
}
/**
$params = $values = $ids = array();
$participantId = Participant::create($this->_contactId, $this->_eventId);
$fetchParticipant = CRM_Event_BAO_Participant::getValues($params, $values, $ids);
- $this->assertNull($fetchParticipant, 'In line ' . __LINE__);
+ $this->assertNull($fetchParticipant);
Contact::delete($this->_contactId);
Event::delete($this->_eventId);
sort($contacts, SORT_NUMERIC);
- $this->assertEquals($ids, $contacts, 'In line ' . __LINE__);
+ $this->assertEquals($ids, $contacts);
}
}
$rc = $obj->formRule($params, $files, $obj);
// Should have found New membership status
- $this->assertTrue($rc, 'In line ' . __LINE__);
+ $this->assertTrue($rc);
}
/**
$rc = $obj->formRule($params, $files, $obj);
// Should have found Grace membership status
- $this->assertTrue($rc, 'In line ' . __LINE__);
+ $this->assertTrue($rc);
}
/**
$rc = $obj->formRule($params, $files, $obj);
// Should have found Expired membership status
- $this->assertTrue($rc, 'In line ' . __LINE__);
+ $this->assertTrue($rc);
}
/**
$params = $this->_params;
unset($params['is_primary']);
$address1 = $this->callAPISuccess('address', 'create', $params);
- $this->assertApiSuccess($address1, 'In line ' . __LINE__);
+ $this->assertApiSuccess($address1);
//now we check & make sure it has been set to primary
$check = $this->callAPISuccess('address', 'getcount', array(
'is_primary' => 1,
// Check result.
$result = $this->callAPISuccess('CaseType', 'get', array('id' => $id));
- $this->assertEquals($result['values'][$id]['id'], $id, 'in line ' . __LINE__);
+ $this->assertEquals($result['values'][$id]['id'], $id);
$this->assertEquals($result['values'][$id]['title'], $params['title']);
}
// Check result
$result = $this->callAPISuccess('CaseType', 'get', array('id' => $id));
- $this->assertEquals($result['values'][$id]['id'], $id, 'in line ' . __LINE__);
+ $this->assertEquals($result['values'][$id]['id'], $id);
$this->assertEquals($result['values'][$id]['title'], $params['title']);
$this->assertEquals($result['values'][$id]['definition'], $params['definition']);
$result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__);
$customFldId = $result['values'][$result['id']]['api.CustomField.create']['id'];
$this->assertNotNull($result['id']);
- $this->assertNotNull($customFldId, 'in line ' . __LINE__);
+ $this->assertNotNull($customFldId);
$params = array(
'id' => $result['id'],
$result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__);
$this->assertNotNull($result['id']);
$customFldDate = date("YmdHis", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest']));
- $this->assertNotNull($customFldDate, 'in line ' . __LINE__);
+ $this->assertNotNull($customFldDate);
$this->assertEquals($dateTime, $customFldDate);
$customValueId = $result['values'][$result['id']]['api.CustomValue.get']['values'][0]['id'];
$dateTime = date('Ymd');
$this->assertNotNull($result['id']);
$customFldDate = date("Ymd", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest']));
$customFldTime = date("His", strtotime($result['values'][$result['id']]['api.CustomValue.get']['values'][0]['latest']));
- $this->assertNotNull($customFldDate, 'in line ' . __LINE__);
+ $this->assertNotNull($customFldDate);
$this->assertEquals($dateTime, $customFldDate);
$this->assertEquals(000000, $customFldTime);
$result = $this->callAPIAndDocument('Contact', 'create', $params, __FUNCTION__, __FILE__);
);
$softcontribution = $this->callAPIAndDocument('contribution_soft', 'get', $params, __FUNCTION__, __FILE__);
$this->assertEquals(1, $softcontribution['count']);
- $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__);
- $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contribution_id'], $this->_contributionId);
+ $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['contact_id'], $this->_softIndividual1Id);
$this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['amount'], '10.00');
$this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['currency'], 'USD');
- $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['soft_credit_type_id'], 4, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$this->_softcontribution['id']]['soft_credit_type_id'], 4);
//create a second soft contribution on the same hard contribution - we are testing that 'id' gets the right soft contribution id (not the contribution id)
$p['contact_id'] = $this->_softIndividual2Id;
);
$softcontribution = $this->callAPIAndDocument('contribution_soft', 'create', $params, __FUNCTION__, __FILE__);
- $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__);
- $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contribution_id'], $this->_contributionId);
+ $this->assertEquals($softcontribution['values'][$softcontribution['id']]['contact_id'], $this->_softIndividual1Id);
$this->assertEquals($softcontribution['values'][$softcontribution['id']]['amount'], '10.00');
$this->assertEquals($softcontribution['values'][$softcontribution['id']]['currency'], 'USD');
- $this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$softcontribution['id']]['soft_credit_type_id'], 5);
}
/**
);
$original = $this->callAPISuccess('contribution_soft', 'get', $old_params);
//Make sure it came back
- $this->assertEquals($original['id'], $softcontributionID, 'In line ' . __LINE__);
+ $this->assertEquals($original['id'], $softcontributionID);
//set up list of old params, verify
$old_contribution_id = $original['values'][$softcontributionID]['contribution_id'];
$old_contact_id = $original['values'][$softcontributionID]['contact_id'];
$old_soft_credit_type_id = $original['values'][$softcontributionID]['soft_credit_type_id'];
//check against original values
- $this->assertEquals($old_contribution_id, $this->_contributionId, 'In line ' . __LINE__);
- $this->assertEquals($old_contact_id, $this->_softIndividual1Id, 'In line ' . __LINE__);
- $this->assertEquals($old_amount, 10.00, 'In line ' . __LINE__);
+ $this->assertEquals($old_contribution_id, $this->_contributionId);
+ $this->assertEquals($old_contact_id, $this->_softIndividual1Id);
+ $this->assertEquals($old_amount, 10.00);
$this->assertEquals($old_currency, 'USD');
- $this->assertEquals($old_soft_credit_type_id, 6, 'In line ' . __LINE__);
+ $this->assertEquals($old_soft_credit_type_id, 6);
$params = array(
'id' => $softcontributionID,
'contribution_id' => $this->_contributionId,
);
$softcontribution = $this->callAPISuccess('contribution_soft', 'get', $new_params);
//check against original values
- $this->assertEquals($softcontribution['values'][$softcontributionID]['contribution_id'], $this->_contributionId, 'In line ' . __LINE__);
- $this->assertEquals($softcontribution['values'][$softcontributionID]['contact_id'], $this->_softIndividual1Id, 'In line ' . __LINE__);
- $this->assertEquals($softcontribution['values'][$softcontributionID]['amount'], 7.00, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$softcontributionID]['contribution_id'], $this->_contributionId);
+ $this->assertEquals($softcontribution['values'][$softcontributionID]['contact_id'], $this->_softIndividual1Id);
+ $this->assertEquals($softcontribution['values'][$softcontributionID]['amount'], 7.00);
$this->assertEquals($softcontribution['values'][$softcontributionID]['currency'], 'CAD');
- $this->assertEquals($softcontribution['values'][$softcontributionID]['soft_credit_type_id'], 7, 'In line ' . __LINE__);
+ $this->assertEquals($softcontribution['values'][$softcontributionID]['soft_credit_type_id'], 7);
$params = array(
'id' => $softcontributionID,
);
$result = $this->callAPIAndDocument('custom_field', 'delete', $params, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
+ $this->assertAPISuccess($result);
}
/**
$customGroup = $this->callAPIFailure('custom_group', 'create', $params);
$this->assertEquals($customGroup['error_message'], 'Mandatory key(s) missing from params array: extends');
- $this->assertAPIFailure($customGroup, 'In line ' . __LINE__);
+ $this->assertAPIFailure($customGroup);
}
/**
'id' => $customGroup['id'],
);
$result = $this->callAPIAndDocument('custom_group', 'delete', $params, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, 'In line ' . __LINE__);
+ $this->assertAPISuccess($result);
}
/**
'contact_id' => $this->_contactID,
));
- $this->assertAPISuccess($get, 'In line ' . __LINE__);
+ $this->assertAPISuccess($get);
$this->assertEquals(0, $get['count'], 'Incorrect email count at ' . __LINE__);
}
'contact_id' => $this->_contactID,
));
- $this->assertAPISuccess($get, 'In line ' . __LINE__);
+ $this->assertAPISuccess($get);
$this->assertEquals(0, $get['count'], 'email already exists ' . __LINE__);
$description = "Demonstrates use of Replace in a nested API call.";
$subfile = "NestedReplaceEmail";
$this->_params[0]['event_title'] = $this->_params[0]['title'];
unset($this->_params[0]['title']);
$result = $this->callAPISuccess('Event', 'Create', $this->_params[0]);
- $this->assertAPISuccess($result, 'In line ' . __LINE__);
+ $this->assertAPISuccess($result);
$this->assertArrayHasKey('id', $result['values'][$result['id']]);
$result = $this->callAPISuccess($this->_entity, 'Get', array('id' => $result['id']));
$this->callAPISuccess($this->_entity, 'Delete', array('id' => $result['id']));
'event_id' => $this->_eventIds[0],
);
$result = $this->callAPISuccess('Event', 'Delete', $params);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
+ $this->assertAPISuccess($result);
}
/**
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
$this->ids['grant'][0] = $result['id'];
$result = $this->callAPIAndDocument($this->_entity, 'get', array('rationale' => 'Just Because'), __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, 'In line ' . __LINE__);
+ $this->assertAPISuccess($result);
$this->assertEquals(1, $result['count']);
}
public function testDeleteGrant() {
$result = $this->callAPISuccess($this->_entity, 'create', $this->params);
$result = $this->callAPIAndDocument($this->_entity, 'delete', array('id' => $result['id']), __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, 'In line ' . __LINE__);
+ $this->assertAPISuccess($result);
$checkDeleted = $this->callAPISuccess($this->_entity, 'get', array());
$this->assertEquals(0, $checkDeleted['count']);
}
);
$membershiptype = $this->callAPIAndDocument('membership_type', 'get', $params, __FUNCTION__, __FILE__);
$this->assertEquals($membershiptype['values'][$id]['name'], 'General');
- $this->assertEquals($membershiptype['values'][$id]['member_of_contact_id'], $this->_contactID, 'In line ' . __LINE__);
- $this->assertEquals($membershiptype['values'][$id]['financial_type_id'], 1, 'In line ' . __LINE__);
+ $this->assertEquals($membershiptype['values'][$id]['member_of_contact_id'], $this->_contactID);
+ $this->assertEquals($membershiptype['values'][$id]['financial_type_id'], 1);
$this->assertEquals($membershiptype['values'][$id]['duration_unit'], 'year');
$this->assertEquals($membershiptype['values'][$id]['duration_interval'], '1');
$this->assertEquals($membershiptype['values'][$id]['period_type'], 'rolling');
'sequential' => 1,
);
$result = $this->callAPISuccess('Note', 'Create', $params);
- $this->assertAPISuccess($result, 'in line ' . __LINE__);
+ $this->assertAPISuccess($result);
$this->assertEquals($result['values'][0]['note'], "Hello!!! ' testing Note");
$this->assertEquals($result['values'][0]['subject'], "With a '");
- $this->assertArrayHasKey('id', $result, 'in line ' . __LINE__);
+ $this->assertArrayHasKey('id', $result);
//CleanUP
$note = array(
// Update Note.
$this->callAPISuccess('note', 'create', $params);
$note = $this->callAPISuccess('Note', 'Get', array());
- $this->assertEquals($note['id'], $this->_noteID, 'in line ' . __LINE__);
- $this->assertEquals($note['values'][$this->_noteID]['entity_id'], $this->_contactID, 'in line ' . __LINE__);
+ $this->assertEquals($note['id'], $this->_noteID);
+ $this->assertEquals($note['values'][$this->_noteID]['entity_id'], $this->_contactID);
$this->assertEquals($note['values'][$this->_noteID]['entity_table'], 'civicrm_contact');
$this->assertEquals('Hello World', $note['values'][$this->_noteID]['subject']);
$this->assertEquals('Note1', $note['values'][$this->_noteID]['note']);
);
$participant = $this->callAPISuccess('participant', 'get', $params);
- $this->assertEquals($participant['count'], 2, 'in line ' . __LINE__);
+ $this->assertEquals($participant['count'], 2);
}
///////////////// civicrm_participant_create methods
$createResult = $this->callAPISuccess($this->_entity, 'create', $this->_params);
$deleteParams = array('id' => $createResult['id']);
$deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($deleteResult, 'In line ' . __LINE__);
+ $this->assertAPISuccess($deleteResult);
$endCount = $this->callAPISuccess($this->_entity, 'getcount', array());
- $this->assertEquals($startCount, $endCount, 'In line ' . __LINE__);
+ $this->assertEquals($startCount, $endCount);
}
public function testGetFieldsPriceField() {
public function testCreatePriceFieldValue() {
$result = $this->callAPIAndDocument($this->_entity, 'create', $this->_params, __FUNCTION__, __FILE__);
- $this->assertAPISuccess($result, 'In line ' . __LINE__);
+ $this->assertAPISuccess($result);
$this->assertEquals(1, $result['count']);
$this->assertNotNull($result['values'][$result['id']]['id']);
$this->getAndCheck($this->_params, $result['id'], $this->_entity);
$deleteResult = $this->callAPIAndDocument($this->_entity, 'delete', $deleteParams, __FUNCTION__, __FILE__);
$endCount = $this->callAPISuccess($this->_entity, 'getcount', array());
- $this->assertEquals($startCount, $endCount, 'In line ' . __LINE__);
+ $this->assertEquals($startCount, $endCount);
}
public function testGetFieldsPriceFieldValue() {
$contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
$this->_ids['contributionId'] = $contribution['id'];
- $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
+ $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00);
+ $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID);
+ $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
+ $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
$this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
- $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 1);
$this->_checkFinancialRecords($contribution, 'online');
}
'contribution_status_id' => 2,
);
$contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
+ $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00);
+ $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID);
+ $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
+ $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
$this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
- $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2);
$this->_checkFinancialRecords($contribution, 'payLater');
}
);
$contribution = $this->callAPIAndDocument('contribution', 'create', $params, __FUNCTION__, __FILE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contact_id'], $this->_individualId);
+ $this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 120.00);
+ $this->assertEquals($contribution['values'][$contribution['id']]['financial_type_id'], $this->financialtypeID);
+ $this->assertEquals($contribution['values'][$contribution['id']]['trxn_id'], 12345);
+ $this->assertEquals($contribution['values'][$contribution['id']]['invoice_id'], 67890);
$this->assertEquals($contribution['values'][$contribution['id']]['source'], 'SSF');
- $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20, 'In line ' . __LINE__);
- $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2, 'In line ' . __LINE__);
+ $this->assertEquals($contribution['values'][$contribution['id']]['tax_amount'], 20);
+ $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status_id'], 2);
$this->_checkFinancialRecords($contribution, 'pending');
}
$result = $this->callAPISuccess('uf_join', 'get', $searchParams);
foreach ($result['values'] as $key => $value) {
- $this->assertEquals($value['uf_group_id'], $this->_ufGroupId, 'In line ' . __LINE__);
+ $this->assertEquals($value['uf_group_id'], $this->_ufGroupId);
}
}