Download the PHP package spatie/test-time without Composer
On this page you can find all versions of the php package spatie/test-time. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spatie/test-time
More information about spatie/test-time
Files in spatie/test-time
Package test-time
Short Description A small package to control the flow time
License MIT
Homepage https://github.com/spatie/test-time
Informations about the package test-time
A helper to control the flow of time
Carbon is an excellent library to work with time in PHP projects. The Spatie\TestTime\TestTime
class contains a few functions that under the hood manipulate the time that's considered the current time by Carbon.
Are you a visual learner?
In this video, you'll learn how we use this package to test time sensitive functionality in Mailcoach.
Support us
We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.
We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.
Installation
You can install the package via composer:
Usage
You can freeze the time with:
Alternatively you can pass in a carbon instance that will be used as the current time.
You can also pass a format and time.
Progressing time
You can progress the time with any of the carbon functions starting with add
or sub
.
Unfreezing time
To let time flow naturally again, call unfreeze
.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security
If you've found a bug regarding security please mail [email protected] instead of using the issue tracker.
Postcardware
You're free to use this package, but if it makes it to your production environment we highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using.
Our address is: Spatie, Kruikstraat 22, 2018 Antwerp, Belgium.
We publish all received postcards on our company website.
Credits
- Freek Van der Herten
- Alex Vanderbist
- All Contributors
License
The MIT License (MIT). Please see License File for more information.