Skip to content

[9.x] More flexibility when time traveling in tests #35338

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

Merged
merged 1 commit into from
Nov 24, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

namespace Illuminate\Foundation\Testing\Concerns;

use DateTimeInterface;
use Illuminate\Foundation\Testing\Wormhole;
use Illuminate\Support\Carbon;

Expand All @@ -22,11 +21,11 @@ public function travel($value)
/**
* Travel to another time.
*
* @param \DateTimeInterface $date
* @param \DateTimeInterface|Closure|Carbon|string|false|null $date
Copy link
Member

Choose a reason for hiding this comment

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

Please use FQN here for the classes.

Copy link
Member

Choose a reason for hiding this comment

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

Also please use bool instead of false.

* @param callable|null $callback
* @return mixed
*/
public function travelTo(DateTimeInterface $date, $callback = null)
public function travelTo($date, $callback = null)
{
Carbon::setTestNow($date);

Expand Down