Commit 92915c55 authored by totten's avatar totten
Browse files

INFRA-132 - tests/ - PHPStorm cleanup

parent 242bd179
......@@ -183,12 +183,13 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
$this->assertEquals(2, $result['count']);
foreach ($result['values'] as $contribution) {
$this->assertEquals($this->callAPISuccess('line_item', 'getvalue', array(
'contribution_id' => $contribution['id'],
'return' => 'line_total',
'contribution_id' => $contribution['id'],
'return' => 'line_total',
)), $contribution['total_amount']);
}
}
/**
* Data provider for test process membership
* @return array
......@@ -202,7 +203,7 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
1 => $this->_contactID,
2 => $this->_contactID2,
3 => $this->_contactID3,
),
),
'field' => array(
1 => array(
'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
......@@ -218,35 +219,35 @@ class CRM_Batch_Form_EntryTest extends CiviUnitTestCase {
'check_number' => NULL,
'contribution_status_id' => 1,
),
2 => array(
'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => '07/03/2013',
'membership_start_date' => '02/03/2013',
'membership_end_date' => NULL,
'membership_source' => NULL,
'financial_type' => 2,
'total_amount' => 1,
'receive_date' => '07/17/2013',
'receive_date_time' => NULL,
'payment_instrument' => NULL,
'check_number' => NULL,
'contribution_status_id' => 1,
),
2 => array(
'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => '07/03/2013',
'membership_start_date' => '02/03/2013',
'membership_end_date' => NULL,
'membership_source' => NULL,
'financial_type' => 2,
'total_amount' => 1,
'receive_date' => '07/17/2013',
'receive_date_time' => NULL,
'payment_instrument' => NULL,
'check_number' => NULL,
'contribution_status_id' => 1,
),
// no join date, coded end date
3 => array(
'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => NULL,
'membership_start_date' => NULL,
'membership_end_date' => '2013-12-01',
'membership_source' => NULL,
'financial_type' => 2,
'total_amount' => 1,
'receive_date' => '07/17/2013',
'receive_date_time' => NULL,
'payment_instrument' => NULL,
'check_number' => NULL,
'contribution_status_id' => 1,
),
3 => array(
'membership_type' => array(0 => $this->_orgContactID, 1 => $this->_membershipTypeID),
'join_date' => NULL,
'membership_start_date' => NULL,
'membership_end_date' => '2013-12-01',
'membership_source' => NULL,
'financial_type' => 2,
'total_amount' => 1,
'receive_date' => '07/17/2013',
'receive_date_time' => NULL,
'payment_instrument' => NULL,
'check_number' => NULL,
'contribution_status_id' => 1,
),
),
'actualBatchTotal' => 0,
......
......@@ -45,9 +45,9 @@ class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase {
*/
public function testACLRoleDeleteFunctionality() {
$optionGroup = civicrm_api('OptionGroup', 'Get', array(
'version' => 3,
'name' => 'acl_role',
'api.OptionValue.Create' =>
'version' => 3,
'name' => 'acl_role',
'api.OptionValue.Create' =>
array(
array(
'label' => 'OG',
......@@ -60,7 +60,7 @@ class CRM_Bridge_OG_DrupalTest extends CiviUnitTestCase {
'description' => 'OG Sync Group ACL :1969:',
),
),
));
));
$getOptionGroupParams = array('version' => 3, 'option_group_id' => $optionGroup['id']);
$originalCount = civicrm_api('OptionValue', 'GetCount', $getOptionGroupParams);
$params = array('source' => 'OG Sync Group ACL :1969:');
......
......@@ -30,8 +30,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
*/
public function testAddWithNames() {
$firstName = 'Shane';
$lastName = 'Whatson';
$params = array(
$lastName = 'Whatson';
$params = array(
'first_name' => $firstName,
'last_name' => $lastName,
'contact_type' => 'Individual',
......@@ -221,8 +221,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
*/
public function testAddWithAllContactTypes() {
$firstName = 'Bill';
$lastName = 'Adams';
$params = array(
$lastName = 'Adams';
$params = array(
'first_name' => $firstName,
'last_name' => $lastName,
'contact_type' => 'Individual',
......@@ -332,7 +332,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
'is_primary' => 1,
);
$compareParams = array(
'street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
'street_address' => CRM_Utils_Array::value('street_address', $params['address'][1]),
'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1',
$params['address'][1]
),
......@@ -360,7 +360,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
//Now check DB for IM
$compareParams = array(
'name' => CRM_Utils_Array::value('name', $params['im'][1]),
'name' => CRM_Utils_Array::value('name', $params['im'][1]),
'provider_id' => CRM_Utils_Array::value('provider_id', $params['im'][1]),
);
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
......@@ -561,8 +561,8 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
CRM_Contact_BAO_Contact_Utils::createCurrentEmployerRelationship($contactId, $orgContact->id);
//retrieve the contact values from database.
$values = array();
$searchParams = array('contact_id' => $contactId);
$values = array();
$searchParams = array('contact_id' => $contactId);
$retrieveContact = CRM_Contact_BAO_Contact::retrieve($searchParams, $values);
//Now check $retrieveContact is object of contact DAO..
......@@ -823,7 +823,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
);
$dbPrefComm = explode(CRM_Core_DAO::VALUE_SEPARATOR,
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
);
$checkPrefComm = array();
foreach ($dbPrefComm as $key => $value) {
......@@ -840,7 +840,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
'is_primary' => 1,
);
$compareParams = array(
'street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
'street_address' => CRM_Utils_Array::value('street_address-Primary', $profileParams),
'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $profileParams),
'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $profileParams),
'city' => CRM_Utils_Array::value('city-Primary', $profileParams),
......@@ -858,7 +858,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
//Now check DB for IM
$compareParams = array(
'name' => CRM_Utils_Array::value('im-Primary', $profileParams),
'name' => CRM_Utils_Array::value('im-Primary', $profileParams),
'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $profileParams),
);
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
......@@ -883,7 +883,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
//get the value of relationship
$values = array();
$values = array();
$searchParams = array('contact_id' => $contactId);
$relationship = CRM_Contact_BAO_Relationship::getValues($searchParams, $values);
//Now check values of Relationship Count.
......@@ -1027,7 +1027,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
);
$dbPrefComm = explode(CRM_Core_DAO::VALUE_SEPARATOR,
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $contactId, 'preferred_communication_method', 'id', TRUE)
);
$checkPrefComm = array();
foreach ($dbPrefComm as $key => $value) {
......@@ -1044,7 +1044,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
'is_primary' => 1,
);
$compareParams = array(
'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
'street_address' => CRM_Utils_Array::value('street_address-Primary', $updatePfParams),
'supplemental_address_1' => CRM_Utils_Array::value('supplemental_address_1-Primary', $updatePfParams),
'supplemental_address_2' => CRM_Utils_Array::value('supplemental_address_2-Primary', $updatePfParams),
'city' => CRM_Utils_Array::value('city-Primary', $updatePfParams),
......@@ -1062,7 +1062,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
//Now check DB for IM
$compareParams = array(
'name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
'name' => CRM_Utils_Array::value('im-Primary', $updatePfParams),
'provider_id' => CRM_Utils_Array::value('im-Primary-provider_id', $updatePfParams),
);
$this->assertDBCompareValues('CRM_Core_DAO_IM', $searchParams, $compareParams);
......@@ -1086,7 +1086,7 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
$this->assertDBCompareValues('CRM_Core_DAO_Phone', $searchParams, $compareParams);
//get the value of relationship
$values = array();
$values = array();
$searchParams = array('contact_id' => $contactId);
$relationship = CRM_Contact_BAO_Relationship::getValues($searchParams, $values);
//Now check values of Relationship Count.
......@@ -1427,15 +1427,15 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
public function testTimestamps_contact() {
$test = $this;
$this->_testTimestamps(array(
'UPDATE' => function ($contactId) use ($test) {
$params = array(
'UPDATE' => function ($contactId) use ($test) {
$params = array(
'first_name' => 'Testing',
'contact_type' => 'Individual',
'contact_id' => $contactId,
);
$contact = CRM_Contact_BAO_Contact::add($params);
$test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
},
$contact = CRM_Contact_BAO_Contact::add($params);
$test->assertInstanceOf('CRM_Contact_DAO_Contact', $contact, 'Check for created object');
},
));
}
......@@ -1445,33 +1445,31 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
public function testTimestamps_email() {
$test = $this;
$this->_testTimestamps(array(
'INSERT' => function ($contactId) use ($test) {
$params = array(
'INSERT' => function ($contactId) use ($test) {
$params = array(
'email' => 'ex-1@example.com',
'is_primary' => 1,
'location_type_id' => 1,
'contact_id' => $contactId,
);
CRM_Core_BAO_Email::add($params);
$test->assertDBQuery('ex-1@example.com',
CRM_Core_BAO_Email::add($params);
$test->assertDBQuery('ex-1@example.com',
'SELECT email FROM civicrm_email WHERE contact_id = %1 ORDER BY id DESC LIMIT 1',
array(1 => array($contactId, 'Integer'))
);
},
'UPDATE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
},
'UPDATE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
'UPDATE civicrm_email SET email = "ex-2@example.com" WHERE contact_id = %1',
array(1 => array($contactId, 'Integer'))
);
},
'DELETE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
},
'DELETE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
'DELETE FROM civicrm_email WHERE contact_id = %1',
array(1 => array($contactId, 'Integer'))
);
},
},
));
}
......@@ -1481,33 +1479,31 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
public function testTimestamps_phone() {
$test = $this;
$this->_testTimestamps(array(
'INSERT' => function ($contactId) use ($test) {
$params = array(
'INSERT' => function ($contactId) use ($test) {
$params = array(
'phone' => '202-555-1000',
'is_primary' => 1,
'location_type_id' => 1,
'contact_id' => $contactId,
);
CRM_Core_BAO_Phone::add($params);
$test->assertDBQuery('202-555-1000',
CRM_Core_BAO_Phone::add($params);
$test->assertDBQuery('202-555-1000',
'SELECT phone FROM civicrm_phone WHERE contact_id = %1 ORDER BY id DESC LIMIT 1',
array(1 => array($contactId, 'Integer'))
);
},
'UPDATE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
},
'UPDATE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
'UPDATE civicrm_phone SET phone = "202-555-2000" WHERE contact_id = %1',
array(1 => array($contactId, 'Integer'))
);
},
'DELETE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
},
'DELETE' => function ($contactId) use ($test) {
CRM_Core_DAO::executeQuery(
'DELETE FROM civicrm_phone WHERE contact_id = %1',
array(1 => array($contactId, 'Integer'))
);
},
},
));
}
......@@ -1527,24 +1523,24 @@ class CRM_Contact_BAO_ContactTest extends CiviUnitTestCase {
$customField = $customField['values'][$customField['id']];
$test = $this;
$this->_testTimestamps(array(
'INSERT' => function ($contactId) use ($test, $customGroup, $customField) {
$result = civicrm_api3('contact', 'create', array(
'INSERT' => function ($contactId) use ($test, $customGroup, $customField) {
$result = civicrm_api3('contact', 'create', array(
'contact_id' => $contactId,
'custom_' . $customField['id'] => 'test-1',
));
},
'UPDATE' => function ($contactId) use ($test, $customGroup, $customField) {
CRM_Core_DAO::executeQuery(
},
'UPDATE' => function ($contactId) use ($test, $customGroup, $customField) {
CRM_Core_DAO::executeQuery(
"UPDATE {$customGroup->table_name} SET {$customField['column_name']} = 'test-2' WHERE entity_id = %1",
array(1 => array($contactId, 'Integer'))
);
},
'DELETE' => function ($contactId) use ($test, $customGroup, $customField) {
CRM_Core_DAO::executeQuery(
},
'DELETE' => function ($contactId) use ($test, $customGroup, $customField) {
CRM_Core_DAO::executeQuery(
"DELETE FROM {$customGroup->table_name} WHERE entity_id = %1",
array(1 => array($contactId, 'Integer'))
);
},
},
));
Custom::deleteGroup($customGroup);
......
......@@ -92,12 +92,12 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
public function testSearchWithType() {
// for type:Individual
$params = array('contact_type' => 'Individual', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$params = array('contact_type' => 'Individual', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$individual = $result['values'][$this->individual];
$individual = $result['values'][$this->individual];
$indiviStudent = $result['values'][$this->indiviStudent];
$indiviParent = $result['values'][$this->indiviParent];
$indiviParent = $result['values'][$this->indiviParent];
//asserts for type:Individual
$this->assertEquals($individual['contact_id'], $this->individual, 'In line ' . __LINE__);
......@@ -156,8 +156,8 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
public function testSearchWithSubype() {
// for subtype:Student
$params = array('contact_sub_type' => $this->student, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$params = array('contact_sub_type' => $this->student, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$indiviStudent = $result['values'][$this->indiviStudent];
......@@ -203,8 +203,8 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
public function testSearchWithTypeSubype() {
// for type:individual subtype:Student
$params = array('contact_sub_type' => $this->student, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$params = array('contact_sub_type' => $this->student, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$indiviStudent = $result['values'][$this->indiviStudent];
......@@ -248,8 +248,8 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
*/
public function testSearchWithInvalidData() {
// for invalid type
$params = array('contact_type' => 'Invalid' . CRM_Core_DAO::VALUE_SEPARATOR . 'Invalid', 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$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__);
// for invalid subtype
......@@ -280,8 +280,8 @@ class CRM_Contact_BAO_ContactType_ContactSearchTest extends CiviUnitTestCase {
// for type:Individual subtype:Sponsor
$defaults = array();
$params = array('contact_type' => 'Individual' . CRM_Core_DAO::VALUE_SEPARATOR . $this->sponsor, 'version' => 3);
$result = civicrm_api('contact', 'get', $params);
$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__);
// for type:Orgaization subtype:Parent
......
......@@ -72,7 +72,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($contact->first_name, 'Anne', 'In line ' . __LINE__);
$this->assertEquals($contact->contact_type, 'Individual', 'In line ' . __LINE__);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
......@@ -85,7 +86,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($contact->organization_name, 'Compumentor', 'In line ' . __LINE__);
$this->assertEquals($contact->contact_type, 'Organization', 'In line ' . __LINE__);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
......@@ -98,7 +100,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($contact->household_name, 'John Does home', 'In line ' . __LINE__);
$this->assertEquals($contact->contact_type, 'Household', 'In line ' . __LINE__);
CRM_Contact_BAO_Contact::deleteContact($contact->id);
......@@ -113,7 +116,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($contact->first_name, 'Bill', 'In line ' . __LINE__);
$this->assertEquals($contact->contact_type, 'Individual', 'In line ' . __LINE__);
$this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->student, 'In line ' . __LINE__);
......@@ -128,7 +132,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($contact->organization_name, 'Conservation Corp', 'In line ' . __LINE__);
$this->assertEquals($contact->contact_type, 'Organization', 'In line ' . __LINE__);
$this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $contact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__);
......@@ -148,7 +153,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$updateParams = array(
'contact_sub_type' => $this->student,
'contact_type' => 'Individual',
......@@ -157,7 +163,8 @@ DELETE FROM civicrm_contact_type
try {
$updatedContact = CRM_Contact_BAO_Contact::add($updateParams);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
$this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__);
$this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->student, 'In line ' . __LINE__);
......@@ -170,7 +177,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$updateParams = array(
'contact_sub_type' => $this->sponsor,
......@@ -180,7 +188,8 @@ DELETE FROM civicrm_contact_type
try {
$updatedContact = CRM_Contact_BAO_Contact::add($updateParams);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
$this->assertEquals($updatedContact->contact_type, 'Organization', 'In line ' . __LINE__);
$this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->sponsor, 'In line ' . __LINE__);
......@@ -201,7 +210,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$updateParams = array(
'contact_sub_type' => $this->parent,
......@@ -211,7 +221,8 @@ DELETE FROM civicrm_contact_type
try {
$updatedContact = CRM_Contact_BAO_Contact::add($updateParams);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
$this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__);
$this->assertEquals(str_replace(CRM_Core_DAO::VALUE_SEPARATOR, '', $updatedContact->contact_sub_type), $this->parent, 'In line ' . __LINE__);
......@@ -225,7 +236,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$updateParams = array(
'contact_sub_type' => $this->team,
......@@ -235,7 +247,8 @@ DELETE FROM civicrm_contact_type
try {
$updatedContact = CRM_Contact_BAO_Contact::add($updateParams);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
$this->assertEquals($updatedContact->contact_type, 'Organization', 'In line ' . __LINE__);
......@@ -251,7 +264,8 @@ DELETE FROM civicrm_contact_type
try {
$contact = CRM_Contact_BAO_Contact::add($params);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$updateParams = array(
'contact_sub_type' => NULL,
......@@ -261,7 +275,8 @@ DELETE FROM civicrm_contact_type
try {
$updatedContact = CRM_Contact_BAO_Contact::add($updateParams);
}
catch(Exception$expected) {}
catch (Exception$expected) {
}
$this->assertEquals($updatedContact->id, $contact->id, 'In line ' . __LINE__);
$this->assertEquals($updatedContact->contact_type, 'Individual', 'In line ' . __LINE__);
......
......@@ -162,8 +162,8 @@ DELETE FROM civicrm_contact_type
'contact_sub_type_b' => $this->parent,
);
$relTypeIds = array();
$relType = CRM_Contact_BAO_RelationshipType::add($relTypeParams, $relTypeIds);
$params = array(
$relType = CRM_Contact_BAO_RelationshipType::add($relTypeParams, $relTypeIds);
$params = array(
'relationship_type_id' => $relType->id . '_a_b',
'contact_check' => array($this->indivi_student => 1),
);
......@@ -189,8 +189,8 @@ DELETE FROM civicrm_contact_type
'contact_type_b' => 'Individual',
);
$relTypeIds = array();
$relType = CRM_Contact_BAO_RelationshipType::add($relTypeParams, $relTypeIds);