class api_v3_ACLPermissionTest extends CiviUnitTestCase {
protected $_apiversion = 3;
protected $_params;
+
+ /**
+ * @var CRM_Utils_Hook_UnitTests
+ */
protected $hookClass = NULL;
public $DBResetRequired = FALSE;
* Function tests that deleted contacts are not returned
*/
function testContactGetPermissionHookNoDeleted() {
- $result = $this->callAPISuccess('contact', 'create', array('id' => 2, 'is_deleted' => 1));
+ $this->callAPISuccess('contact', 'create', array('id' => 2, 'is_deleted' => 1));
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
$result = $this->callAPISuccess('contact', 'get', array(
'check_permissions' => 1,
*/
function testContactGetPledgeIDNotReturned() {
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
- $fullresult = $this->callAPISuccess('contact', 'get', array(
+ $this->callAPISuccess('contact', 'get', array(
'sequential' => 1,
));
$result = $this->callAPISuccess('contact', 'get', array(
*/
function testContactGetPledgeIDNotFiltered() {
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookAllResults'));
- $fullresult = $this->callAPISuccess('contact', 'get', array(
+ $this->callAPISuccess('contact', 'get', array(
'sequential' => 1,
));
$result = $this->callAPISuccess('contact', 'get', array(
*/
function testContactGetPledgeNotChainable() {
$this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereOnlySecond'));
- $fullresult = $this->callAPISuccess('contact', 'get', array(
+ $this->callAPISuccess('contact', 'get', array(
'sequential' => 1,
));
- $result = $this->callAPIFailure('contact', 'get', array(
+ $this->callAPIFailure('contact', 'get', array(
'check_permissions' => 1,
'api.pledge.get' => 1,
'sequential' => 1,
/**
* all results returned
+ * @implements CRM_Utils_Hook::aclWhereClause
*/
function aclWhereHookAllResults($type, &$tables, &$whereTables, &$contactID, &$where) {
$where = " (1) ";
/**
* full results returned
+ * @implements CRM_Utils_Hook::aclWhereClause
*/
function aclWhereOnlySecond($type, &$tables, &$whereTables, &$contactID, &$where) {
$where = " contact_a.id > 1";
}
-
-
}