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

[2.x] Allow string type in greaterThan/lessThan expectations #1055

Merged

Conversation

paulsn-mapon
Copy link
Contributor

What:

  • Bug Fix
  • New Feature

Description:

Since the time type annotations were added to these assertions:

  • toBeLessThan
  • toBeLessThanOrEqual
  • toBeGreaterThan
  • toBeGreaterThanOrEqual

they only allowed int|float (and more recently DateTimeInterface) values as the comparators. However, PHP also has semantics for string comparison which were not taken into account.

This PR adds the appropriate annotation to the expectation so that strings can also be compared among themselves.

Please feel free to adjust the PR to your liking or request changes. Thanks!

@paulsn-mapon paulsn-mapon force-pushed the feature/string-comparison-expectations branch from b4a510c to b1c59ec Compare January 5, 2024 14:21
@nunomaduro nunomaduro merged commit 1153531 into pestphp:2.x Jan 25, 2024
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.

None yet

2 participants