From 7563807424a40b5a8db19db99e8d0c215c8a57cd Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 2 Aug 2013 22:39:25 +1200 Subject: [PATCH] CRM-13149 add relationship type id as a filter option for both 'paths', add tests & tidy up membership.create fn on test class in prep for adding it to tests --- CRM/Contact/BAO/Relationship.php | 22 +++- api/v3/Relationship.php | 16 ++- .../phpunit/CRM/Core/Payment/BaseIPNTest.php | 2 +- .../phpunit/CRM/Member/BAO/MembershipTest.php | 2 +- tests/phpunit/CiviTest/CiviUnitTestCase.php | 34 ++--- .../phpunit/api/v3/MembershipPaymentTest.php | 2 +- tests/phpunit/api/v3/MembershipStatusTest.php | 2 +- tests/phpunit/api/v3/MembershipTest.php | 2 +- tests/phpunit/api/v3/MembershipTypeTest.php | 6 +- tests/phpunit/api/v3/PriceFieldValueTest.php | 2 +- tests/phpunit/api/v3/RelationshipTest.php | 124 +++++++++++++++--- tests/phpunit/api/v3/RelationshipTypeTest.php | 4 +- 12 files changed, 154 insertions(+), 64 deletions(-) diff --git a/CRM/Contact/BAO/Relationship.php b/CRM/Contact/BAO/Relationship.php index 93ef64b11e..b2ce7079e4 100644 --- a/CRM/Contact/BAO/Relationship.php +++ b/CRM/Contact/BAO/Relationship.php @@ -779,12 +779,13 @@ class CRM_Contact_BAO_Relationship extends CRM_Contact_DAO_Relationship { * @param int $count get the no of relationships * $param int $relationshipId relationship id * @param string $direction the direction we are interested in a_b or b_a + * @param array $params array of extra values including relationship_type_id per api spec * * return string the query for this diretion * @static * @access public */ - static function makeURLClause($contactId, $status, $numRelationship, $count, $relationshipId, $direction) { + static function makeURLClause($contactId, $status, $numRelationship, $count, $relationshipId, $direction, $params = array()) { $select = $from = $where = ''; $select = '( '; @@ -886,7 +887,15 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) // CRM-6181 $where .= ' AND civicrm_contact.is_deleted = 0'; - + if(!empty($params['relationship_type_id'])) { + if(is_array($params['relationship_type_id'])) { + // get our special function from DAO to deal with this + // $where .= $this->createSQLFilter('relationship_type_id', $params['relationship_type_id'], 'Integer'); + } + else { + $where .= ' AND relationship_type_id = ' . CRM_Utils_Type::escape($params['relationship_type_id'], 'Positive'); + } + } if ($direction == 'a_b') { $where .= ' ) UNION '; } @@ -908,7 +917,7 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) * $param array $links the list of links to display * $param int $permissionMask the permission mask to be applied for the actions * $param boolean $permissionedContact to return only permissioned Contact - * + * $param array $params array of variables consistent with filters supported by the api * return array $values relationship records * @static * @access public @@ -917,7 +926,8 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) $status = 0, $numRelationship = 0, $count = 0, $relationshipId = 0, $links = NULL, $permissionMask = NULL, - $permissionedContact = FALSE + $permissionedContact = FALSE, + $params = array() ) { $values = array(); if (!$contactId && !$relationshipId) { @@ -925,10 +935,10 @@ LEFT JOIN civicrm_country ON (civicrm_address.country_id = civicrm_country.id) } list($select1, $from1, $where1) = self::makeURLClause($contactId, $status, $numRelationship, - $count, $relationshipId, 'a_b' + $count, $relationshipId, 'a_b', $params ); list($select2, $from2, $where2) = self::makeURLClause($contactId, $status, $numRelationship, - $count, $relationshipId, 'b_a' + $count, $relationshipId, 'b_a', $params ); $order = $limit = ''; diff --git a/api/v3/Relationship.php b/api/v3/Relationship.php index e6ba8153f5..0e754690da 100644 --- a/api/v3/Relationship.php +++ b/api/v3/Relationship.php @@ -136,7 +136,7 @@ function civicrm_api3_relationship_delete($params) { * @access public */ function civicrm_api3_relationship_get($params) { - + $options = _civicrm_api3_get_options_from_params($params); if (!CRM_Utils_Array::value('contact_id', $params)) { $relationships = _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, FALSE); } @@ -145,15 +145,21 @@ function civicrm_api3_relationship_get($params) { $relationships = CRM_Contact_BAO_Relationship::getRelationship($params['contact_id'], CRM_Utils_Array::value('status_id', $params), 0, - 0, - CRM_Utils_Array::value('id', $params), NULL + CRM_Utils_Array::value('is_count', $options), + CRM_Utils_Array::value('id', $params), + NULL, + NULL, + FALSE, + $params ); } + //perhaps we should add a 'getcount' but at this stage lets just handle getcount output + if($options['is_count']) { + return array('count' => $relationships); + } foreach ($relationships as $relationshipId => $values) { _civicrm_api3_custom_data_get($relationships[$relationshipId], 'Relationship', $relationshipId, NULL, CRM_Utils_Array::value('relationship_type_id',$values)); } - - return civicrm_api3_create_success($relationships, $params); } diff --git a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php index def539fe07..3c883b7180 100644 --- a/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/BaseIPNTest.php @@ -485,7 +485,7 @@ class CRM_Core_Payment_BaseIPNTest extends CiviUnitTestCase { */ function _setUpMembershipObjects() { try { - $this->_membershipTypeID = $this->membershipTypeCreate($this->_contactId); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $this->_membershipStatusID = $this->membershipStatusCreate('test status'); } catch(Exception$e) { diff --git a/tests/phpunit/CRM/Member/BAO/MembershipTest.php b/tests/phpunit/CRM/Member/BAO/MembershipTest.php index a24ad5170f..64c409ba61 100644 --- a/tests/phpunit/CRM/Member/BAO/MembershipTest.php +++ b/tests/phpunit/CRM/Member/BAO/MembershipTest.php @@ -66,7 +66,7 @@ class CRM_Member_BAO_MembershipTest extends CiviUnitTestCase { ); $this->_contactID = $this->organizationCreate(); - $this->_membershipTypeID = $this->membershipTypeCreate($this->_contactID); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); // add a random number to avoid silly conflicts with old data $this->_membershipStatusID = $this->membershipStatusCreate('test status' . rand(1, 1000)); } diff --git a/tests/phpunit/CiviTest/CiviUnitTestCase.php b/tests/phpunit/CiviTest/CiviUnitTestCase.php index dee8996821..0a2ef235d0 100644 --- a/tests/phpunit/CiviTest/CiviUnitTestCase.php +++ b/tests/phpunit/CiviTest/CiviUnitTestCase.php @@ -940,36 +940,26 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { } } - function membershipTypeCreate($contactID, $contributionTypeID = 1, $version = 3) { - require_once 'CRM/Member/PseudoConstant.php'; + function membershipTypeCreate($params = array()) { CRM_Member_PseudoConstant::flush('membershipType'); CRM_Core_Config::clearDBCache(); - $params = array( + $params = array_merge(array( 'name' => 'General', 'duration_unit' => 'year', 'duration_interval' => 1, 'period_type' => 'rolling', - 'member_of_contact_id' => $contactID, + 'member_of_contact_id' => 1, 'domain_id' => 1, - // FIXME: I know it's 1, cause it was loaded directly to the db. - // FIXME: when we load all the data, we'll need to address this to - // FIXME: avoid hunting numbers around. - 'financial_type_id' => $contributionTypeID, + 'financial_type_id' => 1, 'is_active' => 1, - 'version' => $version, 'sequential' => 1, 'visibility' => 1, - ); + ), $params); + + $result = $this->callAPISuccess('MembershipType', 'Create', $params); - $result = civicrm_api('MembershipType', 'Create', $params); - require_once 'CRM/Member/PseudoConstant.php'; CRM_Member_PseudoConstant::flush('membershipType'); CRM_Utils_Cache::singleton()->flush(); - if (CRM_Utils_Array::value('is_error', $result) || - (!CRM_Utils_Array::value('id', $result) && !CRM_Utils_Array::value('id', $result['values'][0])) - ) { - throw new Exception('Could not create membership type, with message: ' . CRM_Utils_Array::value('error_message', $result)); - } return $result['id']; } @@ -1028,17 +1018,17 @@ class CiviUnitTestCase extends PHPUnit_Extensions_Database_TestCase { return; } - function relationshipTypeCreate($params = NULL) { - if (is_null($params)) { - $params = array( + function relationshipTypeCreate($params = array()) { + $params = array_merge(array( 'name_a_b' => 'Relation 1 for relationship type create', 'name_b_a' => 'Relation 2 for relationship type create', 'contact_type_a' => 'Individual', 'contact_type_b' => 'Organization', 'is_reserved' => 1, 'is_active' => 1, - ); - } + ), + $params + ); $result = $this->callAPISuccess('relationship_type', 'create', $params); CRM_Core_PseudoConstant::flush('relationshipType'); diff --git a/tests/phpunit/api/v3/MembershipPaymentTest.php b/tests/phpunit/api/v3/MembershipPaymentTest.php index 20a82bbb2f..9bde832bad 100644 --- a/tests/phpunit/api/v3/MembershipPaymentTest.php +++ b/tests/phpunit/api/v3/MembershipPaymentTest.php @@ -46,7 +46,7 @@ class api_v3_MembershipPaymentTest extends CiviUnitTestCase { parent::setUp(); $this->_contactID = $this->organizationCreate(NULL); - $this->_membershipTypeID = $this->membershipTypeCreate($this->_contactID, 1); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $this->_membershipStatusID = $this->membershipStatusCreate('test status'); $activityTypes = CRM_Core_PseudoConstant::activityType(TRUE, TRUE, TRUE, 'name'); $params = array( diff --git a/tests/phpunit/api/v3/MembershipStatusTest.php b/tests/phpunit/api/v3/MembershipStatusTest.php index 52dbd1dd77..675b22dfdf 100644 --- a/tests/phpunit/api/v3/MembershipStatusTest.php +++ b/tests/phpunit/api/v3/MembershipStatusTest.php @@ -46,7 +46,7 @@ class api_v3_MembershipStatusTest extends CiviUnitTestCase { function setUp() { parent::setUp(); $this->_contactID = $this->individualCreate(); - $this->_membershipTypeID = $this->membershipTypeCreate($this->_contactID); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $this->_membershipStatusID = $this->membershipStatusCreate('test status'); CRM_Member_PseudoConstant::membershipType($this->_membershipTypeID, TRUE); diff --git a/tests/phpunit/api/v3/MembershipTest.php b/tests/phpunit/api/v3/MembershipTest.php index 36e81afe30..b0053094ae 100644 --- a/tests/phpunit/api/v3/MembershipTest.php +++ b/tests/phpunit/api/v3/MembershipTest.php @@ -50,7 +50,7 @@ class api_v3_MembershipTest extends CiviUnitTestCase { parent::setUp(); $this->_apiversion = 3; $this->_contactID = $this->individualCreate(); - $this->_membershipTypeID = $this->membershipTypeCreate($this->_contactID); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $this->_membershipStatusID = $this->membershipStatusCreate('test status'); require_once 'CRM/Member/PseudoConstant.php'; diff --git a/tests/phpunit/api/v3/MembershipTypeTest.php b/tests/phpunit/api/v3/MembershipTypeTest.php index e19fd407bd..6b959d2efb 100644 --- a/tests/phpunit/api/v3/MembershipTypeTest.php +++ b/tests/phpunit/api/v3/MembershipTypeTest.php @@ -69,7 +69,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { } function testGet() { - $id = $this->membershipTypeCreate($this->_contactID, 1); + $id = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID)); $params = array( 'id' => $id, @@ -237,7 +237,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { } function testUpdate() { - $id = $this->membershipTypeCreate($this->_contactID, 2); + $id = $this->membershipTypeCreate(array('member_of_contact_id' => $this->_contactID, 'financial_type_id' => 2)); $newMembOrgParams = array( 'organization_name' => 'New membership organisation', 'contact_type' => 'Organization', @@ -271,7 +271,7 @@ class api_v3_MembershipTypeTest extends CiviUnitTestCase { function testDelete() { $orgID = $this->organizationCreate(NULL); - $membershipTypeID = $this->membershipTypeCreate($orgID, 1); + $membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $orgID)); $params = array( 'id' => $membershipTypeID, ); diff --git a/tests/phpunit/api/v3/PriceFieldValueTest.php b/tests/phpunit/api/v3/PriceFieldValueTest.php index aad09910ca..2e51f5c8ed 100644 --- a/tests/phpunit/api/v3/PriceFieldValueTest.php +++ b/tests/phpunit/api/v3/PriceFieldValueTest.php @@ -73,7 +73,7 @@ class api_v3_PriceFieldValueTest extends CiviUnitTestCase { ); $membershipOrgId = $this->organizationCreate(NULL); - $this->_membershipTypeID = $this->membershipTypeCreate($membershipOrgId); + $this->_membershipTypeID = $this->membershipTypeCreate(array('member_of_contact_id' => $membershipOrgId)); $priceSetparams1 = array( 'name' => 'priceset', 'title' => 'Priceset with Multiple Terms', diff --git a/tests/phpunit/api/v3/RelationshipTest.php b/tests/phpunit/api/v3/RelationshipTest.php index a6535a84f9..f3e31f18f9 100644 --- a/tests/phpunit/api/v3/RelationshipTest.php +++ b/tests/phpunit/api/v3/RelationshipTest.php @@ -80,10 +80,11 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { } function tearDown() { - $this->quickCleanup(array('civicrm_relationship'), TRUE); - $this->relationshipTypeDelete($this->_relTypeID); $this->contactDelete($this->_cId_a); $this->contactDelete($this->_cId_b); + $this->contactDelete($this->_cId_b2); + $this->quickCleanup(array('civicrm_relationship'), TRUE); + $this->relationshipTypeDelete($this->_relTypeID); } ///////////////// civicrm_relationship_create methods @@ -214,7 +215,6 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'debug' => 1, ); $result = $this->callAPISuccess('relationship', 'create', $params); - $this->assertAPISuccess($result, 'in line ' . __LINE__); $result = $this->callAPISuccess('relationship', 'get', $params); $params['id'] = $relationship['id']; $result = $this->callAPISuccess('relationship', 'delete', $params); @@ -263,7 +263,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { ); $result = $this->callAPIAndDocument('relationship', 'create', $params, __FUNCTION__, __FILE__); - $this->assertNotNull($result['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['id']); $relationParams = array( 'id' => $result['id'], ); @@ -276,7 +276,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { if ($key == 'note') { continue; } - $this->assertEquals($value, $values[$key], $key . " doesn't match " . print_r($values, TRUE) . 'in line' . __LINE__); + $this->assertEquals($value, $values[$key], $key . " doesn't match " . print_r($values, TRUE)); } $params['id'] = $result['id']; $this->callAPISuccess('relationship', 'delete', $params); @@ -297,7 +297,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('relationship', 'create', $params); - $this->assertNotNull($result['id'], 'in line ' . __LINE__); + $this->assertNotNull($result['id']); $relationParams = array( 'id' => $result['id'], ); @@ -500,8 +500,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'is_active' => 1, ); - $result = $this->callAPIFailure('relationship', 'delete', $params); - $this->assertEquals($result['error_message'], 'Mandatory key(s) missing from params array: id'); + $result = $this->callAPIFailure('relationship', 'delete', $params, 'Mandatory key(s) missing from params array: id'); } /** @@ -514,10 +513,10 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'relationship_type_id' => 'Breaking Relationship', ); - $result = $this->callAPIFailure('relationship', 'delete', $params, 'Mandatory key(s) missing from params array: id', 'in line ' . __LINE__); + $result = $this->callAPIFailure('relationship', 'delete', $params, 'Mandatory key(s) missing from params array: id'); $params['id'] = "Invalid"; - $result = $this->callAPIFailure('relationship', 'delete', $params, 'Invalid value for relationship ID', 'in line ' . __LINE__); + $result = $this->callAPIFailure('relationship', 'delete', $params, 'Invalid value for relationship ID'); } /** @@ -548,8 +547,8 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { * check with empty array */ function testRelationshipUpdateEmpty() { - $result = $this->callAPIFailure('relationship', 'create', array()); - $this->assertEquals('Mandatory key(s) missing from params array: contact_id_a, contact_id_b, relationship_type_id', $result['error_message'], 'In line ' . __LINE__); + $result = $this->callAPIFailure('relationship', 'create', array(), + 'Mandatory key(s) missing from params array: contact_id_a, contact_id_b, relationship_type_id'); } /** @@ -571,7 +570,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { $result = $this->callAPISuccess('relationship', 'create', $relParams); - $this->assertNotNull($result['id'], 'In line ' . __LINE__); + $this->assertNotNull($result['id']); $this->_relationID = $result['id']; $params = array( @@ -583,7 +582,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'is_active' => 0, ); - $result = $this->callAPIFailure('relationship', 'create', $params, 'Relationship already exists', 'In line ' . __LINE__); + $result = $this->callAPIFailure('relationship', 'create', $params, 'Relationship already exists'); //delete created relationship $params = array( @@ -616,18 +615,18 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'contact_id' => $this->_cId_b, ); $result = $this->callAPISuccess('relationship', 'get', $params); - $this->assertEquals($result['count'], 1, 'in line ' . __LINE__); + $this->assertEquals($result['count'], 1); $params = array( 'contact_id_a' => $this->_cId_a, ); $result = $this->callAPISuccess('relationship', 'get', $params); - $this->assertEquals($result['count'], 1, 'in line ' . __LINE__); + $this->assertEquals($result['count'], 1); // contact_id_a is wrong so should be no matches $params = array( 'contact_id_a' => $this->_cId_b, ); $result = $this->callAPISuccess('relationship', 'get', $params); - $this->assertEquals($result['count'], 0, 'in line ' . __LINE__); + $this->assertEquals($result['count'], 0); } /** @@ -782,8 +781,8 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { 'contact_type_a' => 'Individual', 'contact_type_b' => 'Organization', ); - $result = $this->callAPIFailure('relationship_type', 'create', $relTypeParams); - $this->assertEquals('id is not a valid integer', $result['error_message'], 'in line ' . __LINE__); + $result = $this->callAPIFailure('relationship_type', 'create', $relTypeParams, + 'id is not a valid integer'); } /** @@ -806,7 +805,7 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { ); $result = $this->callAPISuccess('relationship', 'get', $contacts); - $this->assertGreaterThan(0, $result['count'], 'in line ' . __LINE__); + $this->assertGreaterThan(0, $result['count']); $params = array( 'id' => $relationship['id'], ); @@ -840,5 +839,90 @@ class api_v3_RelationshipTest extends CiviUnitTestCase { $result = $this->callAPISuccess('relationship', 'delete', $params); $this->relationshipTypeDelete($this->_relTypeID); } + + /** + * Checks that passing in 'contact_id' + a relationship type + * will filter by relationship type (relationships go in both directions) + * as relationship api does a reciprocal check if contact_id provided + * + * We should get 1 result without or with correct relationship type id & 0 with + * an incorrect one + */ + function testGetRelationshipByTypeReciprocal() { + $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); + $result = $this->callAPISuccess($this->_entity, 'get', array( + 'contact_id' => $this->_cId_a, + 'relationship_type_id' => $this->_relTypeID, + )); + $this->assertEquals(1, $result['count']); + $result = $this->callAPISuccess($this->_entity, 'get', array( + 'contact_id' => $this->_cId_a, + 'relationship_type_id' => $this->_relTypeID + 1, + )); + $this->assertEquals(0, $result['count']); + $this->callAPISuccess($this->_entity, 'delete', array('id' => $created['id'])); + } + + /** + * Checks that passing in 'contact_id_b' + a relationship type + * will filter by relationship type for contact b + * + * We should get 1 result without or with correct relationship type id & 0 with + * an incorrect one + */ + function testGetRelationshipByTypeDAO() { + $this->ids['relationship'] = $this->callAPISuccess($this->_entity, 'create', array('format.only_id' => TRUE,) + $this->_params); + $result = $this->callAPISuccess($this->_entity, 'getcount', array( + 'contact_id_a' => $this->_cId_a,), + 1); + $result = $this->callAPISuccess($this->_entity, 'get', array( + 'contact_id_a' => $this->_cId_a, + 'relationship_type_id' => $this->_relTypeID, + )); + $this->assertEquals(1, $result['count']); + $result = $this->callAPISuccess($this->_entity, 'get', array( + 'contact_id_a' => $this->_cId_a, + 'relationship_type_id' => $this->_relTypeID + 1, + )); + $this->assertEquals(0, $result['count']); + } + + /** + * Checks that passing in 'contact_id_b' + a relationship type + * will filter by relationship type for contact b + * + * We should get 1 result without or with correct relationship type id & 0 with + * an incorrect one + */ + function testGetRelationshipByTypeArrayDAO() { + $created = $this->callAPISuccess($this->_entity, 'create', $this->_params); + $org3 = $this->organizationCreate(); + $relType2 = 5; // lets just assume built in ones aren't being messed with! + $relType3 = 6; // lets just assume built in ones aren't being messed with! + + //relationshp 2 + $this->callAPISuccess($this->_entity, 'create', + array_merge($this->_params, array( + 'relationship_type_id' => $relType2, + 'contact_id_b' => $this->_cId_b2)) + ); + + //relationshp 3 + $this->callAPISuccess($this->_entity, 'create', + array_merge($this->_params, array( + 'relationship_type_id' => $relType3, + 'contact_id_b' => $org3)) + ); + + $result = $this->callAPISuccess($this->_entity, 'get', array( + 'contact_id_a' => $this->_cId_a, + 'relationship_type_id' => array('IN' => array($this->_relTypeID, $relType3)), + )); + + $this->assertEquals(2, $result['count']); + foreach ($result['values'] as $key => $value) { + $this->assertTrue(in_array($value['relationship_type_id'], array($this->_relTypeID, $relType3))); + } + } } diff --git a/tests/phpunit/api/v3/RelationshipTypeTest.php b/tests/phpunit/api/v3/RelationshipTypeTest.php index 32d2bf8727..a0c315e0a6 100644 --- a/tests/phpunit/api/v3/RelationshipTypeTest.php +++ b/tests/phpunit/api/v3/RelationshipTypeTest.php @@ -208,7 +208,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { */ function testRelationshipTypeUpdateWithoutContactType() { // create sample relationship type. - $this->_relTypeID = $this->_relationshipTypeCreate(NULL); + $this->_relTypeID = $this->_relationshipTypeCreate(); $relTypeParams = array( 'id' => $this->_relTypeID, @@ -230,7 +230,7 @@ class api_v3_RelationshipTypeTest extends CiviUnitTestCase { */ function testRelationshipTypeUpdate() { // create sample relationship type. - $this->_relTypeID = $this->_relationshipTypeCreate(NULL); + $this->_relTypeID = $this->_relationshipTypeCreate(); $params = array( 'id' => $this->_relTypeID, -- 2.25.1