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.
hyperf/swoole) or RoadRunner for async workloads. The package leverages ReactPHP’s event loop, which can integrate with Laravel’s async ecosystem (e.g., spatie/async or laravel-horizon for queues).TimeOut attribute) address Laravel’s async-heavy tests (e.g., API rate limits, long-running jobs) where synchronous timeouts fail.paratest). Risk: Breaking changes in PHPUnit 12’s assertions or attributes.spatie/async or laravel-horizon already use ReactPHP. Low risk if the app has async infrastructure.expectCallableOnce timing out). Requires careful test design and mocking of async dependencies.TestCase for non-async logic.tests/Unit and async tests in tests/Async (separate directories).spatie/async).paratest.AsyncTestCase.sleep()-based timeouts).#[TimeOut]).spatie/async). Test isolation is critical.AsyncTestCase.sleep() hacks in tests.Xdebug for async debugging.paratest).| Failure Type | Impact | Mitigation |
|---|---|---|
| Fiber timeout | Tests fail due to async delays | Adjust TimeOut attributes conservatively |
| Race conditions | Non-deterministic test failures | Mock async dependencies (e.g., queues) |
| PHP version incompatibility | Package unusable on PHP 8.0 | Upgrade PHP or avoid this package |
| ReactPHP conflicts | Breaks existing async packages | Isolate tests in a separate process |
How can I help you explore Laravel packages today?