From: Coleman Watts Date: Mon, 18 Jan 2016 20:52:36 +0000 (-0500) Subject: CRM-17795 - Test fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0a61b6e25db9f99ca64288f7dc5aefd70c731660;p=civicrm-core.git CRM-17795 - Test fix --- diff --git a/tests/phpunit/api/v3/ACLPermissionTest.php b/tests/phpunit/api/v3/ACLPermissionTest.php index 065e567a70..70ac8d354a 100644 --- a/tests/phpunit/api/v3/ACLPermissionTest.php +++ b/tests/phpunit/api/v3/ACLPermissionTest.php @@ -116,16 +116,17 @@ class api_v3_ACLPermissionTest extends CiviUnitTestCase { * Ensure contact permissions extend to related entities like email */ public function testRelatedEntityPermissions() { + $this->createLoggedInUser(); $disallowedContact = $this->individualCreate(array(), 0); $this->allowedContactId = $this->individualCreate(array(), 1); $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereOnlyOne')); CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM'); $testEntities = array( - 'Email' => array('email' => 'null@nothing'), - 'Phone' => array('phone' => '123456'), - 'IM' => array('name' => 'hello'), + 'Email' => array('email' => 'null@nothing', 'location_type_id' => 1), + 'Phone' => array('phone' => '123456', 'location_type_id' => 1), + 'IM' => array('name' => 'hello', 'location_type_id' => 1), 'Website' => array('url' => 'http://test'), - 'Address' => array('street_address' => '123 Sesame St.'), + 'Address' => array('street_address' => '123 Sesame St.', 'location_type_id' => 1), ); foreach ($testEntities as $entity => $params) { $params += array( diff --git a/tests/phpunit/api/v3/ContactTest.php b/tests/phpunit/api/v3/ContactTest.php index 5133c2efaa..794ac2d914 100644 --- a/tests/phpunit/api/v3/ContactTest.php +++ b/tests/phpunit/api/v3/ContactTest.php @@ -2219,7 +2219,7 @@ class api_v3_ContactTest extends CiviUnitTestCase { $config->userPermissionClass->permissions = array('access CiviCRM'); $result = $this->callAPIFailure('contact', 'update', $params); - $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'); + $this->assertEquals('Permission denied to modify contact record', $result['error_message']); $config->userPermissionClass->permissions = array( 'access CiviCRM',