All Projects → spatie → Test Time

spatie / Test Time

Licence: mit
A helper to control the flow of time

Projects that are alternatives of or similar to Test Time

Travel
Framework agnostic PHP package to control the time.
Stars: ✭ 251 (+48.52%)
Mutual labels:  time, carbon
pest-plugin-test-time
A Pest plugin to control the flow of time
Stars: ✭ 31 (-81.66%)
Mutual labels:  time, carbon
Carbon
A simple, semantic and developer-friendly golang package for datetime
Stars: ✭ 565 (+234.32%)
Mutual labels:  time, carbon
Time Machine
Travel through time in your tests.
Stars: ✭ 143 (-15.38%)
Mutual labels:  time
Dockertest
Write better integration tests! Dockertest helps you boot up ephermal docker images for your Go tests with minimal work.
Stars: ✭ 2,254 (+1233.73%)
Mutual labels:  tests
React Time Picker
A time picker for your React app.
Stars: ✭ 150 (-11.24%)
Mutual labels:  time
Timelapse
🎬 Native macOS app for recording timelapse videos of your desktop.
Stars: ✭ 169 (+0%)
Mutual labels:  time
Easyappointments
Easy!Appointments is a highly customizable web application that allows customers to book appointments with you via a sophisticated web interface. Moreover, it provides the ability to sync your data with Google Calendar so you can use them with other services. It is an open source project that you can download and install even for commercial use. Easy!Appointments will run smoothly with your existing website as it can be installed in a single folder of the server and of course share an existing database.
Stars: ✭ 2,013 (+1091.12%)
Mutual labels:  time
Time
Building a better date/time library for Swift
Stars: ✭ 1,983 (+1073.37%)
Mutual labels:  time
Gostradamus
Gostradamus: Better DateTimes for Go 🕰️
Stars: ✭ 148 (-12.43%)
Mutual labels:  time
Date Picker
📅 Custom responsive date picker widget for Android, written in Kotlin.
Stars: ✭ 146 (-13.61%)
Mutual labels:  time
Date
🗓 A library to help you work with dates in multiple languages, based on Carbon.
Stars: ✭ 1,773 (+949.11%)
Mutual labels:  carbon
Schedule
Schedule is a package that helps tracking schedules for your models. If you have workers in a company, you can set schedules for them and see their availability though the time.
Stars: ✭ 155 (-8.28%)
Mutual labels:  time
Sweep
Extending broom for time series forecasting
Stars: ✭ 143 (-15.38%)
Mutual labels:  time
Carbon
Carbon by Sage | ReactJS UI Component Library
Stars: ✭ 161 (-4.73%)
Mutual labels:  carbon
Delorean
Delorean: Time Travel Made Easy
Stars: ✭ 1,793 (+960.95%)
Mutual labels:  time
Should.js
BDD style assertions for node.js -- test framework agnostic
Stars: ✭ 1,908 (+1028.99%)
Mutual labels:  tests
Tardis
Trace And Rewrite Delays In Syscalls: Hooking time-related Linux syscalls to warp a process's perspective of time, using ptrace.
Stars: ✭ 144 (-14.79%)
Mutual labels:  time
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (-17.16%)
Mutual labels:  tests
React Clock
An analog clock for your React app.
Stars: ✭ 149 (-11.83%)
Mutual labels:  time

A helper to control the flow of time

Latest Version on Packagist GitHub Workflow Status StyleCI Quality Score Total Downloads

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.

// the flow of time is frozen
TestTime::freeze();

// we're now one year in the future
TestTime::addYear();

// will report the real current year + 1
$year = (new Carbon())->format('Y');

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:

composer require spatie/test-time

Usage

You can freeze the time with:

TestTime::freeze();

Alternatively you can pass in a carbon instance that will be used as the current time.

TestTime::freeze($carbonInstance);

You can also pass a format and time.

TestTime::freeze('Y-m-d', '2019-06-12');

You can progress the time with any of the carbon functions starting with add or sub.

TestTime::addMinute();

TestTime::subHours(5);

// you can also chain calls
TestTime::addMonth(3)->addYear();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [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

License

The MIT License (MIT). Please see License File for more information.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].