estahn/phpunit-json-assertions
Expressive JSON assertions for PHPUnit. Verify API responses and JSON documents by structure, values, and types without manually decoding payloads or hand-checking nested arrays. Works with existing test cases to keep your suite readable, precise, and concise.
assertJsonStructure-style key checks). This is a product-visible decision: a stricter contract test suite reduces breaking-change risk for API consumers, but slows down intentional payload evolution.Recommendation posture: treat as an experiment-tier, dev-dependency-only adoption. Zero production blast radius, contained cost of reversal. Do not put it on the critical path of a platform-wide testing standard until the PHPUnit compatibility question is answered.
Consider it when:
composer require --dev and a trait/method import. There's no new runtime, no new service, no infra change.Look elsewhere (or build) when:
opis/json-schema, justinrainbow/json-schema, or equivalent) and skip the assertion wrapper.TestResponse. If your gaps are structural, not schema-level, you may be paying a dependency for something you already have. Confirm the delta before adopting.For executives — one line: A free, dev-only PHP testing add-on that makes it harder to accidentally ship a changed API payload, so downstream teams and clients break less often. It carries no production risk and no licensing cost, but it is a small, low-maintenance project, so we're recommending a contained trial rather than an org-wide standard.
For engineering leadership:
composer.json.Honest framing to include: adoption scores and community signals are weak. This is a "useful small tool worth a cheap trial," not a strategic platform decision — and it should be described that way so nobody over-invests in it.
How can I help you explore Laravel packages today?