From 4f20f3561770ecd53fd58bdb8d001961d1b8a50d Mon Sep 17 00:00:00 2001 From: yashodha Date: Wed, 24 Apr 2013 23:57:03 +0530 Subject: [PATCH] fix test for activity --- tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) 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', -- 2.25.1