* +--------------------------------------------------------------------+
* | CiviCRM version 4.6 |
* +--------------------------------------------------------------------+
- * | Copyright CiviCRM LLC (c) 2004-2014 |
+ * | Copyright CiviCRM LLC (c) 2004-2015 |
* +--------------------------------------------------------------------+
* | This file is a part of CiviCRM. |
* | |
protected $_apiversion = 3;
protected $_cId_a;
/**
- * Second individual
+ * Second individual.
* @var integer
*/
protected $_cId_a_2;
///////////////// civicrm_relationship_create methods
/**
- * Check with empty array
+ * Check with empty array.
*/
public function testRelationshipCreateEmpty() {
$this->callAPIFailure('relationship', 'create', array());
}
/**
- * Check if required fields are not passed
+ * Check if required fields are not passed.
*/
public function testRelationshipCreateWithoutRequired() {
$params = array(
}
/**
- * Check with incorrect required fields
+ * Check with incorrect required fields.
*/
public function testRelationshipCreateWithIncorrectData() {
}
/**
- * Check relationship creation with invalid Relationship
+ * Check relationship creation with invalid Relationship.
*/
public function testRelationshipCreatInvalidRelationship() {
// both the contact of type Individual
}
/**
- * Check relationship already exists
+ * Check relationship already exists.
*/
public function testRelationshipCreateAlreadyExists() {
$params = array(
}
/**
- * Check relationship already exists
+ * Check relationship already exists.
*/
public function testRelationshipCreateUpdateAlreadyExists() {
$params = array(
/**
- * Check relationship creation
+ * Check relationship creation.
*/
public function testRelationshipCreate() {
$params = array(
}
/**
- * Ensure disabling works
+ * Ensure disabling works.
*/
public function testRelationshipUpdate() {
$result = $this->callAPISuccess('relationship', 'create', $this->_params);
}
/**
- * Check relationship creation
+ * Check relationship creation.
*/
public function testRelationshipCreateEmptyEndDate() {
$params = array(
}
/**
- * Check relationship creation with custom data
+ * Check relationship creation with custom data.
*/
public function testRelationshipCreateWithCustomData() {
$customGroup = $this->createCustomGroup();
///////////////// civicrm_relationship_delete methods
/**
- * Check with empty array
+ * Check with empty array.
*/
public function testRelationshipDeleteEmpty() {
$params = array();
}
/**
- * Check if required fields are not passed
+ * Check if required fields are not passed.
*/
public function testRelationshipDeleteWithoutRequired() {
$params = array(
}
/**
- * Check with incorrect required fields
+ * Check with incorrect required fields.
*/
public function testRelationshipDeleteWithIncorrectData() {
$params = array(
}
/**
- * Check relationship creation
+ * Check relationship creation.
*/
public function testRelationshipDelete() {
$params = array(
///////////////// civicrm_relationship_update methods
/**
- * Check with empty array
+ * Check with empty array.
*/
public function testRelationshipUpdateEmpty() {
$result = $this->callAPIFailure('relationship', 'create', array(),
}
/**
- * Check if required fields are not passed
+ * Check if required fields are not passed.
*/
/**
- * Check relationship update
+ * Check relationship update.
*/
public function testRelationshipCreateDuplicate() {
$relParams = array(
$getParams = array(
'filters' => array('is_current' => 1),
);
- $description = "demonstrates is_current filter";
+ $description = "Demonstrates is_current filter.";
$subfile = 'filterIsCurrent';
//no relationship has been created
$result = $this->callAPIAndDocument('relationship', 'get', $getParams, __FUNCTION__, __FILE__, $description, $subfile);
$rel2 = $this->callAPISuccess('relationship', 'create', $rel2Params);
}
- /*
- * Test using various operators
+ /**
+ * Test using various operators.
*/
public function testGetTypeOperators() {
$relTypeParams = array(
'relationship_type_id' => array('IN' => array($relationType2, $relationType3)),
);
- $description = "demonstrates use of IN filter";
+ $description = "Demonstrates use of IN filter.";
$subfile = 'INRelationshipType';
$result = $this->callAPIAndDocument('relationship', 'get', $getParams, __FUNCTION__, __FILE__, $description, $subfile);
$this->assertEquals($result['count'], 2);
$this->AssertEquals(array($rel2['id'], $rel3['id']), array_keys($result['values']));
- $description = "demonstrates use of NOT IN filter";
+ $description = "Demonstrates use of NOT IN filter.";
$subfile = 'NotInRelationshipType';
$getParams = array(
'relationship_type_id' => array('NOT IN' => array($relationType2, $relationType3)),
$this->assertEquals($result['count'], 2);
$this->AssertEquals(array($rel1['id'], $rel4['id']), array_keys($result['values']));
- $description = "demonstrates use of BETWEEN filter";
+ $description = "Demonstrates use of BETWEEN filter.";
$subfile = 'BetweenRelationshipType';
$getParams = array(
'relationship_type_id' => array('BETWEEN' => array($relationType2, $relationType4)),
$this->assertEquals($result['count'], 3);
$this->AssertEquals(array($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 = array(
'relationship_type_id' => array('NOT BETWEEN' => array($relationType2, $relationType4)),
}
/**
- * Check with invalid relationshipType Id
+ * Check with invalid relationshipType Id.
*/
public function testRelationshipTypeAddInvalidId() {
$relTypeParams = array(
}
/**
- * Check with valid data with contact_b
+ * Check with valid data with contact_b.
*/
public function testGetRelationshipWithContactB() {
$relParams = array(
}
/**
- * Check with valid data with relationshipTypes
+ * Check with valid data with relationshipTypes.
*/
public function testGetRelationshipWithRelTypes() {
$relParams = array(
}
/**
+ * Test relationship get by membership type.
+ *
* Checks that passing in 'contact_id_b' + a relationship type
* will filter by relationship type for contact b
*
$this->callAPISuccess($this->_entity, 'create', array('id' => $relationship['id'], 'is_active' => 0));
$this->callAPISuccess($this->_entity, 'create', array('id' => $relationship['id'], 'is_active' => 1));
}
+
}