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

  • Async API Testing Roadmap: Accelerates development of async-capable Laravel/PHP services by providing a dedicated testing framework for asynchronous workflows (e.g., event-driven APIs, background jobs, or reactive systems).
  • Build vs. Buy: Avoids reinventing async test utilities (e.g., custom fibers, timeouts, or mocking) while maintaining compatibility with PHPUnit and ReactPHP’s event loop.
  • Use Cases:
    • Testing Laravel Queues, Horizon, or async job processing.
    • Validating event-driven architectures (e.g., Laravel Echo + Pusher).
    • Simulating race conditions or concurrent requests in API clients.
    • Mocking async callbacks (e.g., expectCallableOnce()) for unit/integration tests.

When to Consider This Package

  • Adopt if:

    • Your team uses ReactPHP or Laravel’s async features (e.g., queues, fibers) and needs robust async test utilities.
    • You require fiber-based test execution with configurable timeouts (default: 30s) to avoid flaky tests.
    • Your project relies on PHPUnit but needs async-specific assertions (e.g., callback validation).
    • You’re building API clients or microservices with async dependencies (e.g., HTTP clients like Guzzle Async).
  • Look elsewhere if:

    • Your stack is fully synchronous (no ReactPHP/Laravel async features).
    • You need GUI-based testing (e.g., Selenium) or browser automation.
    • Your team prefers custom solutions (e.g., PestPHP’s async plugins) or JavaScript/TypeScript tools (e.g., Jest).
    • You require enterprise-grade support (this package has minimal adoption; MIT license but no official backing).

How to Pitch It (Stakeholders)

For Executives: "This package lets us test asynchronous Laravel/PHP features (e.g., queues, event listeners) with the same rigor as synchronous code—reducing flaky tests and speeding up development. It integrates seamlessly with our existing PHPUnit workflow while supporting modern async patterns like fibers and ReactPHP. Low risk (MIT license, active maintenance), high reward for teams scaling async systems."

For Engineering: *"We can now write deterministic async tests with:

  • Fiber-based execution (avoids race conditions).
  • Granular timeouts (per-test or per-class).
  • Callback assertions (e.g., expectCallableOnce() for async handlers).
  • ReactPHP compatibility (works with Laravel’s async queues, HTTP clients, etc.). No need to build custom test harnesses—just extend AsyncTestCase and start testing async logic reliably."*

For QA/DevOps: "Reduces test flakiness in async workflows (e.g., job processing, webhooks) by enforcing timeouts and fiber isolation. Compatible with CI/CD pipelines using PHPUnit, so no tooling changes needed."

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.
nexmo/api-specification
capell-app/block-library
axium/identity
cetria/laravel-dummy-models
cetria/reflection-helper
agropredict/sso-auth-bundle
evolvestudio/spam-protection
datacore/hub-sdk
develia/commons
cuci/prototurk-sdk
cuci/prototurk-sdk-symfony
develia/geo-bundle
dreamzy/livewire-charts
touchestate-sdk/php-sdk
ecotone/kafka
22h/doctrine-garbage-collection-bundle
agtp/agtp-php
agtp/mod-php
splash/sonata-admin
splash/metadata