Weave Code
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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai