$this->assertEquals(0, $result['count']);
}
+ /**
+ * Function tests that an empty where hook returns no results with edit my contact.
+ *
+ * CRM-16512 caused contacts with Edit my contact to be able to view all records.
+ */
+ public function testContactGetNoResultsHookWithEditMyContact() {
+ $this->createLoggedInUser();
+ $this->hookClass->setHook('civicrm_aclWhereClause', array($this, 'aclWhereHookNoResults'));
+ CRM_Core_Config::singleton()->userPermissionClass->permissions = array('access CiviCRM', 'view my contact');
+ $result = $this->callAPISuccess('contact', 'get', array(
+ 'check_permissions' => 1,
+ 'return' => 'display_name',
+ ));
+ $this->assertEquals(0, $result['count']);
+ }
+
/**
* Function tests all results are returned.
*/
}
/**
- * Confirm that without check permissions we still get 2 contacts returned
+ * Confirm that without check permissions we still get 2 contacts returned.
*/
public function testContactGetHookLimitingHookDontCheck() {
$result = $this->callAPISuccess('contact', 'get', array(
/**
* @dataProvider entities
* Function tests that an empty where hook returns no results
- * @param $entity
+ * @param string $entity
* @throws \PHPUnit_Framework_IncompleteTestError
*/
public function testEntityGetNoResultsHook($entity) {