From 1391d5eccfff5e54eee65642095c61f80296f4af Mon Sep 17 00:00:00 2001 From: eileen Date: Thu, 17 Dec 2015 11:41:25 +1300 Subject: [PATCH] CRM-17700 test for custom fields with permissions --- tests/phpunit/api/v3/SyntaxConformanceTest.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index b2433fb012..1ecb250d8c 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -759,6 +759,9 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { */ public function testCustomDataGet($entityName) { $this->createLoggedInUser();// so subsidiary activities are created + // We are not passing 'check_permissions' so the the more limited permissions *should* be + // ignored but per CRM-17700 there is a history of custom data applying permissions when it shouldn't. + CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM', 'view my contact'); $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, $entityName . 'Test.php'); $customFieldName = 'custom_' . $ids['custom_field_id']; $objects = $this->getMockableBAOObjects($entityName, 1); -- 2.25.1