+--------------------------------------------------------------------+
| CiviCRM version 4.7 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2017 |
+ | Copyright CiviCRM LLC (c) 2004-2018 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
$this->customGroupDelete($ids['custom_group_id']);
}
+ /**
+ * Check searching on custom fields with IS NULL.
+ *
+ * https://issues.civicrm.org/jira/browse/CRM-20740
+ */
+ public function testSearchCustomFieldIsNull() {
+ // create custom group with custom field on event
+ $ids = $this->entityCustomGroupWithSingleFieldCreate(__FUNCTION__, __FILE__);
+
+ // Search for events having NULL as the value for this custom
+ // field. This should return all events created in setUp.
+ $check = $this->callAPISuccess($this->_entity, 'get', array(
+ 'custom_' . $ids['custom_field_id'] => array('IS NULL' => 1),
+ ));
+
+ $this->assertGreaterThan(0, $check['count']);
+
+ $this->customFieldDelete($ids['custom_field_id']);
+ $this->customGroupDelete($ids['custom_group_id']);
+ }
+
/**
* Test searching on custom fields returning a contact reference.
*
'title' => 'le cake is a tie',
'check_permissions' => TRUE,
);
- $config = &CRM_Core_Config::singleton();
+ $config = CRM_Core_Config::singleton();
$config->userPermissionClass->permissions = array('access CiviCRM');
$result = $this->callAPIFailure('event', 'create', $params);
$this->assertEquals('API permission check failed for Event/create call; insufficient permission: require access CiviCRM and access CiviEvent and edit all events', $result['error_message'], 'lacking permissions should not be enough to create an event');