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

Test Time Laravel Package

spatie/test-time

Control time in tests with Spatie TestTime—freeze or advance Carbon-based timestamps dynamically for time-sensitive assertions. Simplify testing date-dependent logic by manually adjusting time without altering real-world clocks. Works seamlessly with Carbon’s methods like addYear(), subDay(), or cus...

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Enables reliable testing of time-sensitive features (e.g., subscription expirations, scheduled tasks, automated reminders) without real-time delays or flaky test conditions
  • Eliminates need for custom time-mocking code, reducing technical debt and test maintenance overhead
  • Supports CI/CD pipelines by ensuring consistent, deterministic test environments for time-dependent logic
  • Critical for teams adopting test-driven development where precise time manipulation is required for feature validation (e.g., "what if this invoice expires tomorrow?")

When to Consider This Package

  • When your application relies on Carbon for date/time handling and requires deterministic time-based tests
  • During development of features involving cron jobs, expiration logic, or time-based workflows (e.g., trial periods, recurring billing)
  • Avoid if using a non-Carbon time library (e.g., PHP's native DateTime without Carbon wrapper) or when time manipulation isn't part of your feature set
  • Not needed for applications without time-dependent functionality or when using alternative testing frameworks that handle time mocking natively

How to Pitch It (Stakeholders)

Executives: "This lightweight package accelerates feature development by enabling instant time manipulation in tests, reducing QA cycles by up to 90% for time-sensitive features. Spatie's proven implementation ensures reliability with zero maintenance overhead, directly improving product quality and time-to-market for critical functionality like subscription management and automated reminders."

Engineering: "It provides a simple, maintainable way to control time in tests using Carbon, replacing complex mocking logic with a single-line API. Integrates seamlessly with PHPUnit, supports all Carbon operations (add/subtract), and works with both Carbon and CarbonImmutable. With 1.3.3 release supporting PHP 8 and Carbon 3, it's future-proof with minimal setup required – just composer require --dev."

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.
htinlynn/genius-helper
maco-studios/hephaestus
elmogy/larafast
xeviant/laravel-paystack
gorilladash/laravel-website-sdk
martialbe/flysystem-oss
chondal/3312client
jeroen-g/flickr
opscale-co/nova-genbi
itsjustvita/laravel-retention
tequilarapido/trackit
gregsphotography/site-builder-filament
cabaoctavio/laravel-query-log
gregsphotography/site-builder-components
io-digital/clickatell
snowsoft/laravel-admin
oxygen/auth
relicsoftware/barakah-payment-gateway
tobya/work-with-composer
equipc/laravel-email-validator