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

feat(expectations): support Carbon in toBe #45

Closed
wants to merge 2 commits into from

Conversation

innocenzi
Copy link

@innocenzi innocenzi commented Jul 10, 2023

Q A
Bug fix? no
New feature? yes

This pull request intercepts Pest's toBe to add support for Carbon.

When adding some tests, I was surprised to see that expect($date1)->toBe($date2) did not work. This is actually normal, as objects are checked by reference.

However, I think testing for date equality is something that's done frequently enough to warrant special handling in the Laravel plugin.

Copy link
Contributor

@fabio-ivona fabio-ivona left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Just a potential BC because of the new behavior, but it would be a really edge case, so I'd be fine to merge this to the v2

@innocenzi
Copy link
Author

Hey @nunomaduro, any chance to merge this? 😄

@nunomaduro
Copy link
Member

No plans for this, thanks for your contribution!

@nunomaduro nunomaduro closed this Apr 27, 2024
@innocenzi innocenzi deleted the feat/tobe-carbon branch April 27, 2024 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants