Download the PHP package spatie/pest-plugin-test-time without Composer
On this page you can find all versions of the php package spatie/pest-plugin-test-time. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download spatie/pest-plugin-test-time
More information about spatie/pest-plugin-test-time
Files in spatie/pest-plugin-test-time
Package pest-plugin-test-time
Short Description A Pest plugin to control the flow of time
License MIT
Homepage https://github.com/spatie/pest-plugin-test-time
Informations about the package pest-plugin-test-time
A Pest plugin to control the flow of time
This Pest plugin offers a function testTime
that allows you to freeze and manipulate the current time in your tests.
It also contains a custom expectation called toBeCarbon
to easily check the values of Carbon
instances.
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.
Requirements
This package is a wrapper around Carbon's setTestNow()
function. Therefore, you can only use this Pest plugin only in projects that use Carbon.
Installation
You can install the package via composer:
Usage
You can call freeze
on the testTime
function to freeze the current time.
Freezing at a specific point in time
You can also freeze the time at a specific point by passing the time in format Y-m-d H:i:s
.
Changing the time
You can change the time, by calling any of the add
and sub
functions that are available on Carbon
.
Expecting a Carbon value
This package offers a custom expectation called toBeCarbon
to easily check the value of a Carbon
instance.
Testing
Changelog
Please see CHANGELOG for more information on what has changed recently.
Contributing
Please see CONTRIBUTING for details.
Security Vulnerabilities
Please review our security policy on how to report security vulnerabilities.
Credits
- Freek Van der Herten
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of pest-plugin-test-time with dependencies
nesbot/carbon Version ^2.65|^3
pestphp/pest Version ^2.0|^3.0
spatie/test-time Version ^1.3.2