*
* @return array
* API Result Array
+ *
+ * @throws \API_Exception
*/
function civicrm_api3_contact_get($params) {
$options = [];
* Array of options (so we can modify the filter).
*/
function _civicrm_api3_contact_get_supportanomalies(&$params, &$options) {
+ if (!empty($params['email']) && !is_array($params['email'])) {
+ // Fix this to be in array format so the query object does not add LIKE
+ // I think there is a better fix that I will do for master.
+ $params['email'] = ['=' => $params['email']];
+ }
if (isset($params['showAll'])) {
if (strtolower($params['showAll']) == "active") {
$params['contact_is_deleted'] = 0;
/**
* Verify that attempt to create individual contact with only an email succeeds.
+ *
+ * @throws \CRM_Core_Exception
*/
public function testCreateEmailIndividual() {
$primaryEmail = 'man3@yahoo.com';
$this->assertEquals($primaryEmail, $email1['values'][$email1['id']]['email']);
// Case 3: Check with email_id='primary email id'
- $result = $this->callAPISuccess('contact', 'get', ['email_id' => $email1['id']]);
- $this->assertEquals(1, $result['count']);
+ $result = $this->callAPISuccessGetSingle('contact', ['email_id' => $email1['id']]);
$this->assertEquals($contact1['id'], $result['id']);
+ // Check no wildcard is appended
+ $this->callAPISuccessGetCount('Contact', ['email' => 'man3@yahoo.co'], 0);
+
$this->callAPISuccess('contact', 'delete', $contact1);
}