Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
core
/
vendor
/
laravel
/
framework
/
src
/
Illuminate
/
Foundation
/
Testing
/
Concerns
:
InteractsWithTime.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php namespace Illuminate\Foundation\Testing\Concerns; use DateTimeInterface; use Illuminate\Foundation\Testing\Wormhole; use Illuminate\Support\Carbon; trait InteractsWithTime { /** * Begin travelling to another time. * * @param int $value * @return \Illuminate\Foundation\Testing\Wormhole */ public function travel($value) { return new Wormhole($value); } /** * Travel to another time. * * @param \DateTimeInterface $date * @param callable|null $callback * @return mixed */ public function travelTo(DateTimeInterface $date, $callback = null) { Carbon::setTestNow($date); if ($callback) { return tap($callback(), function () { Carbon::setTestNow(); }); } } /** * Travel back to the current time. * * @return \DateTimeInterface */ public function travelBack() { return Wormhole::back(); } }