$this->assertEquals($employer, $organisation);
//Update relationship type
- $update = $this->callAPISuccess('Relationship', 'create', [
+ $this->callAPISuccess('Relationship', 'create', [
'id' => $employerRelationship['id'],
'relationship_type_id' => $this->_relTypeID,
]);
];
$result = $this->callAPIAndDocument('relationship', 'get', $getParams, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals($result['count'], 2);
- $this->AssertEquals([$rel1['id'], $rel4['id']], array_keys($result['values']));
+ $this->assertEquals([$rel1['id'], $rel4['id']], array_keys($result['values']));
- $description = "Demonstrates use of BETWEEN filter.";
+ $description = 'Demonstrates use of BETWEEN filter.';
$subfile = 'BetweenRelationshipType';
$getParams = [
'relationship_type_id' => ['BETWEEN' => [$relationType2, $relationType4]],
$this->assertEquals($result['count'], 3);
$this->AssertEquals([$rel2['id'], $rel3['id'], $rel4['id']], array_keys($result['values']));
- $description = "Demonstrates use of Not BETWEEN filter.";
+ $description = 'Demonstrates use of Not BETWEEN filter.';
$subfile = 'NotBetweenRelationshipType';
$getParams = [
'relationship_type_id' => ['NOT BETWEEN' => [$relationType2, $relationType4]],
];
$result = $this->callAPIAndDocument('relationship', 'get', $getParams, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals($result['count'], 1);
- $this->AssertEquals([$rel1['id']], array_keys($result['values']));
+ $this->assertEquals([$rel1['id']], array_keys($result['values']));
foreach ([$relationType2, $relationType3, $relationType4] as $id) {
$this->callAPISuccess('RelationshipType', 'delete', ['id' => $id]);
*
* We should get 1 result without or with correct relationship type id & 0 with
* an incorrect one
+ *
* @param int $version
+ *
* @dataProvider versionThreeAndFour
+ * @throws \CRM_Core_Exception
*/
public function testGetRelationshipByMembershipTypeDAO($version) {
$this->_apiversion = $version;
$result = $this->callAPISuccess($this->entity, 'get', [
'contact_id_a' => $this->_cId_a,
'membership_type_id' => $memberType,
+ // Pass version here as there is no intention to replicate support for passing in membership_type_id
+ 'version' => 3,
]);
// although our contact has more than one relationship we have passed them in as contact_id_a & can't get reciprocal
$this->assertEquals(1, $result['count']);
*
* We should get 1 result without or with correct relationship type id & 0 with
* an incorrect one
+ *
* @param int $version
+ *
* @dataProvider versionThreeAndFour
+ * @throws \CRM_Core_Exception
*/
public function testGetRelationshipByMembershipTypeReciprocal($version) {
$this->_apiversion = $version;
$result = $this->callAPISuccess($this->entity, 'get', [
'contact_id' => $this->_cId_a,
'membership_type_id' => $memberType,
+ // There is no intention to replicate support for passing in membership_type_id
+ // in apiv4 so pass version as 3
+ 'version' => 3,
]);
// Although our contact has more than one relationship we have passed them in as contact_id_a & can't get reciprocal
$this->assertEquals(2, $result['count']);