Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[php8-compat][REF] Fix Date unit tests in php8 by passing in 00 inste… #20525

Merged
merged 1 commit into from
Jun 7, 2021

Conversation

seamuslee001
Copy link
Contributor

…ad of null for hours,minutes and seconds

Overview

This fixes a test failures such as

CRM_Utils_DateTest::testRelativeEarlierDay
Failed asserting that two arrays are equal.
--- Expected
+++ Actual
@@ @@
 Array (
     'from' => null
-    'to' => '20210605000000'
+    'to' => '20210605003229'
 )

Before

Date test fails in php8

After

Date tests pass in php8

Technical Details

as per https://www.php.net/manual/en/function.mktime.php#refsect1-function.mktime-changelog the hours, minutes and seconds is now nullable and this means that if null is passed in the current time values for that section is used

ping @eileenmcnaughton @totten @demeritcowboy

@civibot
Copy link

civibot bot commented Jun 7, 2021

(Standard links)

@civibot civibot bot added the master label Jun 7, 2021
@demeritcowboy
Copy link
Contributor

Looks ok - just wondering what happens with month, day, year since it says they are also nullable now - I don't have php 8 installed anywhere but I suppose I should do that.

@demeritcowboy demeritcowboy merged commit 00d08b4 into civicrm:master Jun 7, 2021
@eileenmcnaughton eileenmcnaughton deleted the fix_date_tests branch June 7, 2021 19:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants