$dao->name = $name;
if ($dao->find(TRUE)) {
$params = array(
- 'version' => 3,
'id' => $dao->entity_id,
);
- $result = civicrm_api($dao->entity_type, 'getsingle', $params);
- if ($result['is_error']) {
+ try {
+ $result = civicrm_api3($dao->entity_type, 'getsingle', $params);
+ }
+ catch (Exception $e) {
$this->onApiError($params, $result);
- } else {
- return $result;
}
+ return $result;
} else {
return NULL;
}
require_once 'CiviTest/CiviUnitTestCase.php';
class CRM_Core_ManagedEntitiesTest extends CiviUnitTestCase {
- //@todo make BAO enotice compliant & remove the line below
- // WARNING - NEVER COPY & PASTE $_eNoticeCompliant = FALSE
- // new test classes should be compliant.
- public $_eNoticeCompliant = FALSE;
function get_info() {
return array(
'name' => 'ManagedEntities',