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

[3.x] More flexibility when time traveling in tests #57

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

shane-zeng
Copy link
Contributor

Q A
Bug fix? no
New feature? yes
Fixed tickets 0

When using the Pest\Laravel\travelTo function, I encountered an error. Based on the current documentation and examples, this function should accept various date inputs, allowing tests to travel to a specific point in time effortlessly. However, when I passed in a string (e.g., travelTo('2024-11-12 10:00:00')), it raised a TypeError:

TypeError: Pest\Laravel\travelTo(): Argument #1 ($date) must be of type DateTimeInterface, string given, called in /Volumes/workspace/Code/api/tests/Unit/Http/Controllers/Api/Admin/Eshops/GroupBlueprintControllerTest.php on line 21
at vendor/pestphp/pest-plugin-laravel/src/Time.php:48

Therefore, this update was made with reference to laravel/framework#35338

@owenvoke owenvoke merged commit f322269 into pestphp:3.x Nov 12, 2024
18 checks passed
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.

2 participants