tourze/phpunit-json-rpc
A PHPUnit extension for testing JSON-RPC services. It helps PHP developers send requests, validate responses, and assert protocol behavior in automated test suites, making JSON-RPC API integration testing simpler and more reliable.
jsonrpc is "2.0", that id is echoed, that errors use the reserved -32xxx codes, that batch arrays preserve order/response-mapping). This package is a candidate to replace that bespoke code. The decision matters because internal test harnesses are classic undifferentiated heavy lifting — they accrue maintenance cost, get copy-pasted across repos, and rot silently when nobody owns them.require-dev, never ships to production, and can be ripped out in an afternoon. That makes the decision cheap and reversible — which is precisely the argument for spending a small amount of time evaluating it now rather than deferring.Adopt when:
id echo semantics, batch and notification handling — rather than generic "did it return HTTP 200 with a body" checks. This is the package's core value: it encodes the spec so your team doesn't have to keep re-deriving it.Look elsewhere when:
Caveats on the 1.0.0 signal — read the release, not the number. Reaching 1.0.0 is genuinely meaningful: it is the maintainer's public commitment to semantic versioning, which converts future upgrades from "read every diff" to "read the changelog." That is the main reason this release warrants a decision now rather than later. However, the release notes for 1.0.0 are effectively empty (a changelog link only, no migration guidance, no documented API surface). The version number is a promise; the artefact backing it is currently unverified. Before committing, diff the tag against the prior release and confirm PHPUnit version compatibility against your matrix — 1.0.0 is often where a library freezes its supported-version floor.
For executives (30 seconds): This is a small, free, development-only library for testing a specific kind of API contract. It never runs in production, cannot affect customers, and can be removed in an afternoon if we change our minds. It replaces hand-written test plumbing that we would otherwise maintain forever, and its 1.0.0 release means the author has committed to stable interfaces — upgrades become routine rather than risky. The ask is a short evaluation spike, not budget. The only real risk is that the project is maintained by a very small team; we mitigate that by wrapping it in a thin internal adapter so we are never more than a day away from replacing it.
For engineering leads: Dev dependency, require-dev only. Value is spec conformance for JSON-RPC 2.0 — error codes, id echo, batch/notification semantics — asserted in PHPUnit rather than reinvented per repo. Actions: (1) verify PHPUnit compatibility against our current and next-version matrix; (2) pin the exact version and let our dependency bot surface upgrades; (3) isolate all usage behind an internal test-support helper so a future swap or fork is a single-file change; (4) treat 1.0.0's empty release notes as unverified — diff the tag before adopting. If any of those four steps fails, the correct outcome is to decline and keep the internal helper, not to negotiate around it.
Decision framing: low cost, low risk, narrow applicability, reversible. The failure mode to avoid is neither adopting nor declining — it is quietly accumulating three different half-maintained JSON-RPC assertion helpers across three repos while this decision stays open.
How can I help you explore Laravel packages today?