From b886f2bff0198100fcc1b63729e286e57e0fc472 Mon Sep 17 00:00:00 2001 From: Sandor Semsey Date: Sat, 6 Jun 2020 14:57:16 +0200 Subject: [PATCH] Earlier.day test --- tests/phpunit/CRM/Utils/DateTest.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/phpunit/CRM/Utils/DateTest.php b/tests/phpunit/CRM/Utils/DateTest.php index 630e897edf..01da0b7b44 100644 --- a/tests/phpunit/CRM/Utils/DateTest.php +++ b/tests/phpunit/CRM/Utils/DateTest.php @@ -304,4 +304,16 @@ class CRM_Utils_DateTest extends CiviUnitTestCase { $this->assertEquals(CRM_Utils_Date::customFormatTs($ts, "%Y"), "2018"); } + /** + * Test Earlier Day Relative term to absolute + */ + public function testRelativeEarlierDay() { + $date=CRM_Utils_Date::relativeToAbsolute('earlier', 'day'); + + $this->assertEquals([ + 'from' => null, + 'to' => date('Ymd000000', strtotime('-1 day')), + ], $date); + } + } -- 2.25.1