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

Async Test Utilities Laravel Package

wyrihaximus/async-test-utilities

Async test utilities for PHP that provide a TestCase with random namespaces and directories, fiber-based test execution with a configurable TimeOut attribute, and callable expectation helpers for ReactPHP async tests.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Engineering-velocity investment, not a product feature. This is a require-dev package. It ships no runtime code, so it never appears on a customer-facing roadmap. The decision it informs is "how much do we invest in test infrastructure for our async/concurrent PHP services?"
  • Test reliability for async code. If any part of the product runs on ReactPHP (event loop, promises, React\Async fibers), flaky, timing-dependent tests are a recurring tax: re-runs in CI, false red builds, slow feedback. AsyncTestCase gives every test a fiber, a default 30s timeout, and a per-class/per-method #[TimeOut] attribute — directly converting "hangs forever / passes only on my laptop" into deterministic failures.
  • Fixture hygiene as a policy. Random namespaces and random temp directories for file-storage tests remove an entire class of parallel-run collision bugs. That's a decision about whether parallel CI test execution is allowed at all.
  • Build vs. buy: the surface is tiny (base test case, timeout attribute, callable-expectation helpers, random namespace/dir). An in-house equivalent is plausibly ~100–200 lines. "Buy" wins only because the price is zero (MIT) and the maintenance is automated; "build" wins if you need to own the API or can't accept the install-time behaviour below.
  • Use cases it does not unlock: no new customer segment, no pricing change, no compliance posture change. Treat it as a line item in a platform-engineering / developer-experience budget, decided by the tech lead, not by product.

When to Consider This Package

Adopt only when all of these hold:

  • Your codebase already depends on ReactPHP (react/event-loop, react/promise, react/async) in production code and your tests need to exercise that loop.
  • You are on PHP 8.4+ and PHPUnit 12.x — this package tracks those aggressively and raises its floor on major releases.
  • You want fiber-per-test isolation with a declarative timeout, and you're willing to have every test extend a vendor base class (a real coupling cost).
  • You accept single-maintainer risk: 4 stars, 0 dependents, and the v10.0.0 release notes state plainly, "AFAIK I'm the only one using this package, plus the orgs I use it in." That is the honest adoption signal — plan for the possibility you are the only external consumer.

Look elsewhere (or build in-house) when:

  • You're on amphp, Swoole, or plain synchronous PHP — the helpers are ReactPHP-shaped and won't fit.
  • You need a versioned stability guarantee, security review, or vendor support. There is none.
  • The v10.0.0 composer script rewrite is a blocker. On install/update, this package rewrites your composer.json post-install-cmd / post-update-cmd blocks to call make on-install-or-update, and will create those blocks if absent. Supply-chain-sensitive orgs should refuse this outright; it's an install-time mutation of your build config by a dev dependency.
  • You're staying on an older PHPUnit/PHP; the release history is almost entirely dependency bumps, so version drift is frequent by design.

How to Pitch It (Stakeholders)

For executives (30 seconds): This is a free, MIT-licensed developer tool that makes tests for our asynchronous PHP code stop hanging and stop flaking. It's a dev-only dependency — zero runtime footprint, zero customer impact, no license cost. The catch is that it's effectively a one-person project with no meaningful external adoption, and since v10 it edits our composer.json on install. Recommendation: approve as a time-boxed experiment on the one service that actually uses ReactPHP, with a documented exit path, not as a standards-level dependency.

For engineering leadership: The value is concentrated and real — fiber-per-test execution, a default 30s global timeout with #[TimeOut] overrides at class and method level, random namespaces/temp dirs for storage fixtures, and expectCallableExactly / expectCallableOnce helpers. That's maybe a day of internal work to replicate, so the honest framing is convenience, not capability. The risks are equally concentrated: bus factor of one; no dependents to validate it; a hard coupling to PHP 8.4 + PHPUnit 12; and an install-time composer.json rewrite that will fail review in any org with supply-chain controls.

Recommended decision: Pilot it behind a spike branch, measure flaky-test rate and CI wall-clock before/after, and set a 30-day checkpoint. If the in-house alternative is cheap (it likely is at this surface area), prefer owning a ~150-line base test case and keep the vendor dependency out of the build graph entirely.

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.
3mdikram/worldmoneywords
snowsoft/config
itmosoft/laravel-subscriptions
larva/laravel-ai-qwen
diephp/sequences
users-au/socialite-provider
twidpay/twid-logger
mrnewport/laravel-plaid
mrnewport/laravel-repo
mrnewport/laravel-docsign
mrnewport/laravel-stow
mrnewport/laravel-flow
mrnewport/laravel-priceable
mrnewport/laravel-nestedterms
fredmeng/laravel-apidoc-generator
itstructure/laravel-multilingual-tools
pdustdar/elasticsearch
markupai/php-sdk
rlacerda83/lumem-microservice-shipment
uni-method/symfony-lib