예제 #1
0
 /**
  * testcase for deleteActivityAssignment() method. 
  * deleteActivityAssignment($activityId) method deletes activity assignment for given activity id.   
  */
 function testDeleteActivityAssignment()
 {
     $contactId = Contact::createIndividual();
     $params = array('first_name' => 'liz', 'last_name' => 'hurleey');
     $assigneeContactId = Contact::createIndividual($params);
     $params = array('source_contact_id' => $contactId, 'subject' => 'Scheduling Meeting', 'activity_type_id' => 2, 'assignee_contact_id' => array($assigneeContactId), 'activity_date_time' => date('Ymd'));
     require_once 'CRM/Activity/BAO/Activity.php';
     CRM_Activity_BAO_Activity::create($params);
     $activityId = $this->assertDBNotNull('CRM_Activity_DAO_Activity', 'Scheduling Meeting', 'id', 'subject', 'Database check for created activity.');
     $activityAssignmentId = $this->assertDBNotNull('CRM_Activity_DAO_ActivityAssignment', $assigneeContactId, 'id', 'target_contact_id', 'Database check for created activity assignment.');
     CRM_Activity_BAO_Activity::deleteActivityAssignment($activityId);
     $this->assertDBNull('CRM_Activity_DAO_ActivityAssignment', $assigneeContactId, 'id', 'assignee_contact_id', 'Database check for deleted activity assignment.');
     Contact::delete($contactId);
     Contact::delete($assigneeContactId);
 }