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

Make createFromFormat work the same with mocked time #2823

Merged
merged 2 commits into from
Jul 12, 2023

Conversation

kylekatarnls
Copy link
Collaborator

Fix #2821

@kylekatarnls kylekatarnls added this to the 2.69.0 milestone Jul 11, 2023
@kylekatarnls kylekatarnls force-pushed the fix/issue-2821-create-from-format-time branch from 39fc048 to 7bba4ba Compare July 11, 2023 21:36
kylekatarnls added a commit to kylekatarnls/framework that referenced this pull request Jul 11, 2023
Microsecond was 0 because of a PHP bug:
https://bugs.php.net/bug.php?id=74332

And because Carbon aligned its behavior.

But it now longer make sense now that most PHP versions handle it properly so I plan to remove this hack
briannesbitt/Carbon#2823

In order to keep the Laravel tests compatible, the easiest way would be ignore microsecond in the date comparison assertion.
taylorotwell pushed a commit to laravel/framework that referenced this pull request Jul 12, 2023
Microsecond was 0 because of a PHP bug:
https://bugs.php.net/bug.php?id=74332

And because Carbon aligned its behavior.

But it now longer make sense now that most PHP versions handle it properly so I plan to remove this hack
briannesbitt/Carbon#2823

In order to keep the Laravel tests compatible, the easiest way would be ignore microsecond in the date comparison assertion.
@kylekatarnls kylekatarnls force-pushed the fix/issue-2821-create-from-format-time branch 2 times, most recently from 88f784e to ef3c9b3 Compare July 12, 2023 07:55
@kylekatarnls kylekatarnls force-pushed the fix/issue-2821-create-from-format-time branch from ef3c9b3 to e198336 Compare July 12, 2023 09:11
@kylekatarnls kylekatarnls merged commit eeb761b into master Jul 12, 2023
@kylekatarnls kylekatarnls deleted the fix/issue-2821-create-from-format-time branch August 19, 2023 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant