From: yashodha Date: Wed, 24 Apr 2013 18:27:03 +0000 (+0530) Subject: fix test for activity X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=4f20f3561770ecd53fd58bdb8d001961d1b8a50d;p=civicrm-core.git fix test for activity --- diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 23d9837b79..42853f942f 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -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',