<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.4 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2013 |
+--------------------------------------------------------------------+
protected $_tagID;
protected $_apiversion = 3;
protected $_tag;
+ protected $_entity = 'entity_tag';
public $_eNoticeCompliant = TRUE;
function setUp() {
$this->_individualID = $this->individualCreate();
$this->_tag = $this->tagCreate();
$this->_tagID = $this->_tag['id'];
- $this->_householdID = $this->houseHoldCreate(NULL);
- $this->_organizationID = $this->organizationCreate(NULL);
+ $this->_householdID = $this->houseHoldCreate();
+ $this->_organizationID = $this->organizationCreate();
}
function tearDown() {
}
///////////////// civicrm_entity_tag_get methods
- function testGetWrongParamsType() {
+ function testGetNoEntityID() {
$ContactId = $this->_individualID;
$tagID = $this->_tagID;
$params = array(
$individualEntity = $this->callAPISuccess('entity_tag', 'create', $params);
$this->assertEquals($individualEntity['added'], 1);
- }
-
- function testIndividualEntityTagGetWithoutContactID() {
- $paramsEntity = array();
- $entity = $this->callAPIFailure('entity_tag', 'get', $paramsEntity,
- 'Mandatory key(s) missing from params array: entity_id'
- );
+ $result = $this->callAPISuccess($this->_entity, 'get', array('sequential' => 1, 'tag_id' => $tagID));
+ $this->assertEquals($ContactId, $result['values'][0]['entity_id']);
}
function testIndividualEntityTagGet() {
$entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity);
}
- function testHouseholdEntityGetWithoutContactID() {
- $entity = $this->callAPIFailure('entity_tag', 'get', array());
- }
-
function testHouseholdEntityGet() {
$ContactId = $this->_householdID;
$tagID = $this->_tagID;
$this->assertEquals($householdEntity['added'], 1);
}
- function testOrganizationEntityGetWithoutContactID() {
- $entity = $this->callAPIFailure('entity_tag', 'get', array());
- }
-
function testOrganizationEntityGet() {
$ContactId = $this->_organizationID;
$tagID = $this->_tagID;
$entity = $this->callAPISuccess('entity_tag', 'get', $paramsEntity);
}
- ///////////////// civicrm_entity_tag_remove methods
- function testEntityTagRemoveNoTagId() {
+ ///////////////// civicrm_entity_tag_Delete methods
+ function testEntityTagDeleteNoTagId() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,
);
}
- function testEntityTagRemoveINDHH() {
+ function testEntityTagDeleteINDHH() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,
$this->assertEquals($result['removed'], 1);
}
- function testEntityTagRemoveHHORG() {
+ function testEntityTagDeleteHHORG() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,
}
- function testEntityTagCommonRemoveINDHH() {
+ function testEntityTagCommonDeleteINDHH() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,
$this->assertEquals($result['removed'], 2);
}
- function testEntityTagCommonRemoveHH() {
+ function testEntityTagCommonDeleteHH() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,
$this->assertEquals($result['removed'], 1);
}
- function testEntityTagCommonRemoveHHORG() {
+ function testEntityTagCommonDeleteHHORG() {
$entityTagParams = array(
'contact_id_i' => $this->_individualID,
'contact_id_h' => $this->_householdID,