From 688bd604d2b259c93a79b48052fe4b56a81584a4 Mon Sep 17 00:00:00 2001 From: eileenmcnaugton Date: Mon, 14 Mar 2016 22:19:51 +1300 Subject: [PATCH] CRM-18233 Fix modified_date action schedule test --- tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php index 6e46bfe5e9..75d65ed1b6 100644 --- a/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php +++ b/tests/phpunit/CRM/Core/BAO/ActionScheduleTest.php @@ -1186,6 +1186,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { public function testContactModifiedAnniversary() { $contact = $this->callAPISuccess('Contact', 'create', $this->fixtures['contact_birthdate']); $this->_testObjects['CRM_Contact_DAO_Contact'][] = $contact['id']; + $modifiedDate = $this->callAPISuccess('Contact', 'getvalue', array('id' => $contact['id'], 'return' => 'modified_date')); $actionSchedule = $this->fixtures['sched_contact_mod_anniv']; $actionScheduleDao = CRM_Core_BAO_ActionSchedule::add($actionSchedule); $this->assertTrue(is_numeric($actionScheduleDao->id)); @@ -1197,7 +1198,7 @@ class CRM_Core_BAO_ActionScheduleTest extends CiviUnitTestCase { ), array( // On the eve of 3 years after they were modified, send an email. - 'time' => date('Y-m-d H:i:s', strtotime($contact['values'][$contact['id']]['modified_date'] . ' +3 years -23 hours')), + 'time' => date('Y-m-d H:i:s', strtotime($modifiedDate . ' +3 years -1 day')), 'recipients' => array(array('test-bday@example.com')), ), )); -- 2.25.1