From: eileenmcnaugton Date: Mon, 14 Mar 2016 09:19:51 +0000 (+1300) Subject: CRM-18233 Fix modified_date action schedule test X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=688bd604d2b259c93a79b48052fe4b56a81584a4;p=civicrm-core.git CRM-18233 Fix modified_date action schedule test --- 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')), ), ));