From f5052d4d940851b9bff739c8ee174afca3ed5a16 Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 17:54:39 +1200 Subject: [PATCH] minor test tidy-up - esp remove unused vars --- tests/phpunit/api/v3/ACLPermissionTest.php | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/phpunit/api/v3/ACLPermissionTest.php b/tests/phpunit/api/v3/ACLPermissionTest.php index 88b0881e81..6b18decdc8 100644 --- a/tests/phpunit/api/v3/ACLPermissionTest.php +++ b/tests/phpunit/api/v3/ACLPermissionTest.php @@ -37,6 +37,10 @@ require_once 'CiviTest/CiviUnitTestCase.php'; class api_v3_ACLPermissionTest extends CiviUnitTestCase { protected $_apiversion = 3; protected $_params; + + /** + * @var CRM_Utils_Hook_UnitTests + */ protected $hookClass = NULL; public $DBResetRequired = FALSE; @@ -97,7 +101,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * 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, @@ -185,7 +189,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { */ 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( @@ -201,7 +205,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { */ 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( @@ -217,10 +221,10 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { */ 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, @@ -237,6 +241,7 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * all results returned + * @implements CRM_Utils_Hook::aclWhereClause */ function aclWhereHookAllResults($type, &$tables, &$whereTables, &$contactID, &$where) { $where = " (1) "; @@ -244,11 +249,10 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { /** * full results returned + * @implements CRM_Utils_Hook::aclWhereClause */ function aclWhereOnlySecond($type, &$tables, &$whereTables, &$contactID, &$where) { $where = " contact_a.id > 1"; } - - } -- 2.25.1