Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Timecop Bundle

Timecop Bundle Laravel Package

kolemp/timecop-bundle

Timecop Bundle freezes, travels, and scales time in your tests so date- and time-dependent code behaves predictably. Control the clock globally, write deterministic assertions for Carbon and DateTime, and eliminate flaky time-based failures.

View on GitHub
Deep Wiki
Context7

At a glance

Frequently asked questions about Timecop Bundle
Does kolemp/timecop-bundle work with Laravel?
No, kolemp/timecop-bundle is a Symfony bundle. It ships a Bundle subclass, DI extension, and configuration tree that Laravel does not consume, and it has no Laravel service provider, facade, or auto-discovery entry. In a Laravel app the bundle scaffolding is dead weight; only the underlying time-interception library could potentially be reused, and that is a separate dependency with its own risk.
How do I install kolemp/timecop-bundle?
It is installed with Composer, but it is intended for Symfony applications, not Laravel. Installing it in a Laravel project would pull symfony/http-kernel into the dependency graph purely to satisfy the bundle base class. There is no config publishing or Laravel auto-discovery, so the usual Laravel install steps do not apply.
What is the difference between Timecop Bundle and Carbon::setTestNow()?
Carbon::setTestNow() is Laravel's first-party, maintained way to freeze or travel the clock for Carbon and DateTime code. Timecop Bundle wraps a separate Timecop PHP library in Symfony integration and was last released in 2018. For typical Laravel date assertions, Carbon::setTestNow() is strictly simpler and has no extra dependency.
Does Timecop Bundle freeze native PHP time() and new DateTime()?
The evaluation could not confirm the clock-interception mechanism. Freezing native time(), microtime(), and new DateTime() usually requires a PECL extension, namespace rewriting, or autoload trickery, which the assessment flags as a CI portability risk. If the package only affects Carbon, it is inferior to Carbon::setTestNow().
Is kolemp/timecop-bundle still maintained?
The last release was 2018-09-18, leaving roughly seven years without a tag. It is a single-maintainer project with a bus factor of one and no downstream dependents to absorb maintenance. That dormancy makes it a poor choice for a current Laravel or PHP 8.x stack.
What Symfony versions does Timecop Bundle support?
The 2018 release date implies Symfony HttpKernel constraints from the ^3/^4 era and PHP 7-era code. Compatibility with modern Symfony or PHP 8.1+ is unverified and likely to contend with deprecations and Carbon 2/3. The package does not target Laravel at all.
How do I freeze or travel time in Laravel tests?
Use Laravel's built-in test helpers: travelTo(), travel(5)->minutes(), and freezeTime() in feature tests, or Carbon::setTestNow($when) with Carbon::setTestNow() in tearDown. These are framework-native, documented, and require no new Composer dependency. For native time functions outside Carbon, refactor the call site behind an injectable clock interface such as PSR-20's ClockInterface.
Does Timecop Bundle require a PECL extension?
The evaluation does not confirm the interception mechanism, but native PHP time-function interception commonly requires uopz, runkit, or similar PECL tooling. If Timecop Bundle depends on that, it is a hard no for portable CI. That question should be closed before any further evaluation spend.
Can I use Timecop Bundle for production time control?
Timecop Bundle is aimed at tests and development, not production clock control. Even there, the Symfony-only integration and 2018 maintenance status make it a poor fit for Laravel. Production time behavior should be handled through injectable clocks and configuration, not runtime interception.
What are alternatives to Timecop Bundle for Laravel?
For Laravel, use Carbon::setTestNow(), travelTo(), travel(), and freezeTime() rather than a Symfony bundle. If you need to control native time functions, inject a PSR-20 ClockInterface implementation instead of intercepting the runtime. If you must reuse Timecop code, the assessment suggests at most vendoring the relevant MIT-licensed classes after proving a specific gap.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
novasa/laravel-language-center
opencage/geocode
adolfoholzer/parameters
livenetworks/ln-starter
shitoudev/permissionmanager
johannesclimacus/laravel-tui
hocvt/seotools
vitalybaev/sypexgeo
amphibee/themosis-ignition
gito-me/fast-excel
frankyso/laravel-ipaymu
geolize-studio/laravel-chile
boomerangui/chat
jinas/dhivatar
store-doc/laravel-storage-driver
plus-it/laravel-translation-manager
diephp/perhaps
diephp/telegraph
osmaviation/spreadsheet
microsoft/fluentui-system-icons