From dcbec3608fdd102f1938282d1a4127828ccb2d8d Mon Sep 17 00:00:00 2001 From: Eileen McNaughton Date: Sat, 24 May 2014 19:30:27 +1200 Subject: [PATCH] more tidy ups from phpstorm --- CRM/Core/Config.php | 5 +++++ CRM/Core/Permission/Base.php | 3 +++ tests/phpunit/api/v3/ContactTest.php | 4 ++-- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CRM/Core/Config.php b/CRM/Core/Config.php index 1510711b19..72553ed90e 100644 --- a/CRM/Core/Config.php +++ b/CRM/Core/Config.php @@ -85,6 +85,11 @@ class CRM_Core_Config extends CRM_Core_Config_Variables { */ public $userSystem = NULL; + /** + * @var CRM_Core_Permission_Base + */ + public $userPermissionClass; + /** * The root directory where Smarty should store compiled files * diff --git a/CRM/Core/Permission/Base.php b/CRM/Core/Permission/Base.php index f6c5d387cf..d8b0c1f9db 100644 --- a/CRM/Core/Permission/Base.php +++ b/CRM/Core/Permission/Base.php @@ -38,6 +38,9 @@ */ class CRM_Core_Permission_Base { + // permission mapping to stub check() calls + public $permissions = NULL; + /** * Translate permission * diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index f954342466..1b9c84e995 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -1662,7 +1662,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals('API permission check failed for contact/create call; insufficient permission: require access CiviCRM and add contacts', $result['error_message'], 'lacking permissions should not be enough to create a contact'); $config->userPermissionClass->permissions = array('access CiviCRM', 'add contacts', 'import contacts'); - $result = $this->callAPISuccess('contact', 'create', $params, NULL, 'overfluous permissions should be enough to create a contact'); + $this->callAPISuccess('contact', 'create', $params, NULL, 'overfluous permissions should be enough to create a contact'); } function testContactUpdatePermissions() { @@ -1676,7 +1676,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $this->assertEquals('API permission check failed for contact/update call; insufficient permission: require access CiviCRM and edit all contacts', $result['error_message'], 'lacking permissions should not be enough to update a contact'); $config->userPermissionClass->permissions = array('access CiviCRM', 'add contacts', 'view all contacts', 'edit all contacts', 'import contacts'); - $result = $this->callAPISuccess('contact', 'update', $params, NULL, 'overfluous permissions should be enough to update a contact'); + $this->callAPISuccess('contact', 'update', $params, NULL, 'overfluous permissions should be enough to update a contact'); } function createContactFromXML() { -- 2.25.1