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

Phpunit Json Rpc Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Build vs. buy for test tooling. Every team exposing a JSON-RPC 2.0 surface eventually writes throwaway assertion helpers (checking that 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.
  • Roadmap sequencing for protocol-level API work. If JSON-RPC endpoints (batch requests, notifications, named vs. positional params, error-object conformance) appear anywhere on the near-term roadmap, adoption is cheapest before the endpoints ship. Retrofitting conformance tests after clients depend on slightly-off behaviour is materially more expensive than writing them up front.
  • Standardization across services. A single, shared assertion vocabulary for JSON-RPC means test suites in different repos read the same way. That lowers the cost of moving engineers between squads and makes CI failures legible to anyone, not just the original author.
  • Release-gating and CI policy. This is a dev-only dependency: it sits behind 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.
  • Explicitly not a production-facing product decision. Nothing here changes runtime behaviour, latency, or the customer-facing surface. Treat it as an engineering-enablement line item, not a product bet.

When to Consider This Package

Adopt when:

  • You own or consume a JSON-RPC 2.0 API and your test suite is written in PHP / runs on PHPUnit (Laravel or otherwise).
  • You want protocol-level assertions — error-code correctness, 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.
  • Your team is small enough that consolidating test helpers in a maintained dependency is a net win over an internal utility.
  • You are willing to pin the version and accept a small-vendor dependency behind a thin internal adapter.

Look elsewhere when:

  • Your APIs are REST or GraphQL. This is a narrow-purpose tool; there is no partial-fit story.
  • Your test stack is not PHP/PHPUnit — the ecosystem lock-in is total.
  • You require vendor support, an SLA, or a completed security/procurement review. A single-maintainer package with a bare changelog will not clear most enterprise gates, and shouldn't be forced through them for a dev dependency.
  • You need broader capability than assertion helpers: consumer-driven contract testing (Pact and similar), schema-driven validation from an OpenAPI/JSON-Schema source of truth, or load/performance testing. This package does none of those.
  • You cannot tolerate bus-factor risk in the build pipeline at all — in which case fork it under your org and own the ~small surface area deliberately, rather than depending on it implicitly.

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.

How to Pitch It (Stakeholders)

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.

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.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package