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

Async Test Utilities Laravel Package

wyrihaximus/async-test-utilities

Async testing utilities for PHP/React: extend AsyncTestCase to run each PHPUnit test inside a Fiber with a default 30s timeout. Includes TimeOut attribute (class/method), plus helpers like random namespaces/directories and callable expectation utilities.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Accelerate async testing adoption: Enables seamless integration of asynchronous testing patterns (e.g., ReactPHP fibers) into Laravel/PHPUnit test suites, reducing flakiness in event-driven or I/O-bound tests.
  • Roadmap alignment: Supports initiatives to modernize testing infrastructure for async workflows (e.g., queues, event listeners, or HTTP clients).
  • Build vs. buy: Avoids reinventing async test utilities (e.g., custom assertions, timeouts, or fiber management) while maintaining compatibility with Laravel’s ecosystem.
  • Use cases:
    • Testing Laravel queue workers or async jobs (e.g., shouldBeDispatched() assertions).
    • Validating event-driven logic (e.g., expectCallableOnce() for listeners).
    • Simulating delayed responses (e.g., API timeouts or external service calls).

When to Consider This Package

  • Adopt if:
    • Your Laravel app uses async primitives (ReactPHP, Symfony Messenger, queues) and tests require fiber-based execution.
    • You need fine-grained control over test timeouts (e.g., 30s default, customizable per test/method).
    • Your team prioritizes reusable test utilities (e.g., random directories, callable expectations) over bespoke solutions.
  • Look elsewhere if:
    • Your tests are synchronous-only (no async dependencies like fibers or promises).
    • You require enterprise-grade support (package has low stars/dependents; consider paid alternatives like PestPHP’s async plugins).
    • Your CI/CD pipeline struggles with fiber compatibility (ensure PHP 8.1+ and ReactPHP support).

How to Pitch It (Stakeholders)

For Executives: "This package lets us write robust async tests for Laravel’s event-driven features (e.g., queues, webhooks) without reinventing the wheel. It integrates with PHPUnit, reduces flaky tests, and aligns with our roadmap to modernize testing. Low risk—MIT-licensed and actively maintained."

For Engineering: "We can now test async code (e.g., sleep(1) in fibers, queue jobs) deterministically with built-in timeouts and assertions. Example: Verify a job is dispatched exactly 3 times using expectCallableExactly(). Compatible with Laravel’s testing tools and ReactPHP. Tradeoff: Minimal learning curve (extends AsyncTestCase)."

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