soft-passio/api-test-cases
Soft Passio API Test Cases is a Laravel package for defining and running API test cases, letting you assert endpoints, responses, status codes, and auth flows so your JSON APIs stay reliable as they grow.
Architecture fit. soft-passio/api-test-cases is a PHPUnit test-case library — a dev-only dependency that provides base TestCase classes and request/assertion helpers for functional API testing. Two things stand out immediately:
Bundle suffix (ApiTestCasesBundle), not Laravel's package conventions. That suggests the abstractions were designed around the Symfony HttpKernel/KernelBrowser model rather than Laravel's Illuminate\Foundation\Testing\TestCase + MakesHttpRequests trait. If so, the architecture is adjacent to, not native to, our stack.MakesHttpRequests, assertJson*, RefreshDatabase, withoutMiddleware, Sanctum/Passport helpers). The package's real marginal value is convention and scaffolding, not capability.Integration feasibility. Low-to-moderate, and gated on the PHP/PHPUnit version matrix. Last release 2020-06-13 places it in the PHP 7.x / PHPUnit 8–9 era. A modern Laravel app on PHP 8.1+ and PHPUnit 10/11 will hit hard incompatibilities: setUp() signature and return-type changes, removal of deprecated assertion behavior, and the annotation-to-attribute migration. Expect Composer resolution to fail on constraint alone; the realistic paths are --ignore-platform-reqs (unwise), pinning the project's PHPUnit down (unacceptable), or forking.
Technical risk. Adoption signals are effectively zero — 0 stars, 0 dependents, no release in five years. That means no community scrutiny, no CVE triage, no upstream responsiveness, no third-party documentation or Stack Overflow corpus. The mitigating factor is blast radius: as a test-only dependency it does not ship to production, so the worst case is a broken or misleading test suite, not a runtime compromise. The subtler risk is misleading — helper libraries that swallow exceptions or auto-handle responses can produce green tests that assert nothing.
Key questions to resolve before any decision.
MakesHttpRequests, assertJsonStructure, and Pest's it() DSL do not?php, phpunit/phpunit, and framework constraints, and what is the license?Stack fit. Poor for greenfield Laravel 10/11 on PHP 8.2+. Plausible only for a legacy Laravel 6/7 service on PHP 7.4 where the team already has PHPUnit 8/9 and wants a shared API test scaffold. Because the fit is conditional, this should not be treated as a framework-wide standard.
Migration path. There is no migration here — it is not replacing existing tooling, it would be additive scaffolding at best. The recommended path is:
tests/Support base case — no dependency, full ownership; (b) fork into an internal internal/api-test-kit package under our namespace with our own PHPUnit constraint; (c) adopt the upstream package pinned to an exact version, dev-only.Compatibility. Regardless of path, do not let an abandoned package dictate the project's PHPUnit version. If the spike succeeds, invert the constraint by forking rather than holding the suite back. Verify transitive dev dependencies are pinned and scanned; dev dependencies are still executable code in CI.
Sequencing. Inventory current test conventions → spike → gap analysis → decision gate → (if adopting) fork/pin + CI + ownership → rollout by domain, starting with one service → document conventions before a second team copies them.
Maintenance. Effectively zero upstream. Every future PHP or PHPUnit upgrade becomes our problem, and it will break first at the base-class boundary, which is the hardest place to patch. Budget this as a small but permanent internal maintenance line, not a one-time install.
Support. No vendor, no maintainer response since 2020, no issue triage. Internal support requires a named owning engineer and a short runbook covering "how to bump PHPUnit," "how to add an assertion helper," and "what to do when the base class breaks." Without that, the package becomes orphaned inside our repo and gets copy-pasted into new services by pattern-matching.
Scaling. Test-suite scale, not traffic scale. Base-class helper patterns — app reboot per test, fixture reloading, shared static state — degrade superlinearly as suites grow into the thousands. An abandoned library also cannot adopt newer PHPUnit capabilities (parallel execution, attributes, #[DataProvider] ergonomics), so it becomes a ceiling on suite performance rather than a floor. Watch specifically for shared mutable state in the base class, which is a common source of order-dependent flakes.
Failure modes.
Ramp-up. Superficially low — engineers fluent in PHPUnit and Laravel's test helpers will read it quickly. Structurally higher: it imposes bespoke conventions with no external documentation, no community examples, and no Stack Overflow coverage, so onboarding knowledge is non-transferable and lives entirely in whoever ran the spike. That is the strongest argument for option (a) — reimplementing the useful 10% in our own tests/Support keeps the knowledge, the ownership, and the upgrade path inside the team, and costs roughly the same as the spike itself.
How can I help you explore Laravel packages today?