fix test for activity
authoryashodha <yashodha.chaku@webaccess.co.in>
Wed, 24 Apr 2013 18:27:03 +0000 (23:57 +0530)
committeryashodha <yashodha.chaku@webaccess.co.in>
Wed, 24 Apr 2013 18:27:21 +0000 (23:57 +0530)
tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php

index 23d9837b79ff3f65b983abcd00079b5b0d333764..42853f942f29a9699bcd7cd4a7961aa886e87a4a 100644 (file)
@@ -213,12 +213,16 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $this->assertTrue(is_numeric($actionScheduleDao->id));
 
     $activity = $this->createTestObject('CRM_Activity_DAO_Activity', $this->fixtures['phonecall']);
-    // $activity = $this->createTestObject('CRM_Activity_DAO_Activity', $this->fixtures['phonecall']);
     $this->assertTrue(is_numeric($activity->id));
     $contact = civicrm_api('contact', 'create', $this->fixtures['contact']);
-    $activity->source_contact_id = $contact['id'];
     $activity->save();
 
+    $source['contact_id'] = $contact['id'];
+    $source['activity_id'] = $activity->id;
+    $source['record_type_id'] = 2;
+    $activityContact = $this->createTestObject('CRM_Activity_DAO_ActivityContact', $source);
+    $activityContact->save();
+
     $this->assertCronRuns(array(
       array( // Before the 24-hour mark, no email
         'time' => '2012-06-14 04:00:00',
@@ -242,9 +246,14 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase {
     $activity = $this->createTestObject('CRM_Activity_DAO_Activity', $this->fixtures['phonecall']);
     $this->assertTrue(is_numeric($activity->id));
     $contact = civicrm_api('contact', 'create', $this->fixtures['contact']);
-    $activity->source_contact_id = $contact['id'];
     $activity->save();
 
+    $source['contact_id'] = $contact['id'];
+    $source['activity_id'] = $activity->id;
+    $source['record_type_id'] =2;
+    $activityContact = $this->createTestObject('CRM_Activity_DAO_ActivityContact', $source);
+    $activityContact->save();
+
     $this->assertCronRuns(array(
       array( // Before the 24-hour mark, no email
         'time' => '012-06-14 04:00:00',